Sha256: a32bc12a396cba65964ee770e3660f514a1d42f9659fb5100f159544c5925864

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe Highrise::Subject do

  before(:each) do
    @subject = Highrise::Subject.new
  end
  
  it "should be instance of Highrise::Base" do
    @subject.kind_of?(Highrise::Base).should be_true
  end
  
  describe ".notes" do

    it "should delegate to Highrise::Note with correct params" do
      @subject.should_receive(:id).and_return(1)
      Highrise::Note.should_receive(:find_all_across_pages).with({:from=>"/subjects/1/notes.xml"}).and_return("notes")
      @subject.notes.should == "notes"
    end

  end

  describe ".emails" do

    it "should delegate to Highrise::Email with correct params" do
      @subject.should_receive(:id).and_return(1)
      Highrise::Email.should_receive(:find_all_across_pages).with({:from=>"/subjects/1/emails.xml"}).and_return("emails")
      @subject.emails.should == "emails"
    end

  end
  
  describe ".upcoming_tasks" do

    it "should delegate to Highrise::Task with correct params" do
      @subject.should_receive(:id).and_return(1)
      Highrise::Task.should_receive(:find).with(:all, {:from=>"/subjects/1/tasks.xml"}).and_return("tasks")
      @subject.upcoming_tasks.should == "tasks"
    end

  end

end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
kmayer-highrise-0.7.0 spec/highrise/subject_spec.rb
kmayer-highrise-0.7.1 spec/highrise/subject_spec.rb
slainer68-highrise-0.6.1 spec/highrise/subject_spec.rb
slainer68-highrise-0.6.2 spec/highrise/subject_spec.rb
slainer68-highrise-0.6 spec/highrise/subject_spec.rb
tapajos-highrise-0.6 spec/highrise/subject_spec.rb
tapajos-highrise-0.8.0 spec/highrise/subject_spec.rb