Sha256: db9df2dc601b75a9b7803ef06d1834ec5d2fdc85c151c669ce9f28c1b56f7020

Contents?: true

Size: 1.1 KB

Versions: 18

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe Highrise::Subject do
  subject { Highrise::Subject.new(:id => 1) }

  it { should be_a_kind_of Highrise::Base }

  it "#notes" do
    Highrise::Note.should_receive(:find_all_across_pages).with({:from=>"/subjects/1/notes.xml"}).and_return("notes")
    subject.notes.should == "notes"
  end

  it "#add_note" do
    Highrise::Note.should_receive(:create).with({:body=>"body", :subject_id=>1, :subject_type=>'Subject'}).and_return(mock('note'))
    subject.add_note :body=>'body'
  end
  
  it "#add_task" do
    Highrise::Task.should_receive(:create).with({:body=>"body", :subject_id=>1, :subject_type=>'Subject'}).and_return(mock('task'))
    subject.add_task :body=>'body'
  end

  it "#emails" do
    Highrise::Email.should_receive(:find_all_across_pages).with({:from=>"/subjects/1/emails.xml"}).and_return("emails")
    subject.emails.should == "emails"
  end

  it "#upcoming_tasks" do
    Highrise::Task.should_receive(:find).with(:all, {:from=>"/subjects/1/tasks.xml"}).and_return("tasks")
    subject.upcoming_tasks.should == "tasks"
  end
  
  it { subject.label.should == "Subject" }
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
highrise-3.2.1 spec/highrise/subject_spec.rb
highrise-3.1.6 spec/highrise/subject_spec.rb
highrise-3.1.5 spec/highrise/subject_spec.rb
highrise-3.1.2 spec/highrise/subject_spec.rb
highrise-3.1.1 spec/highrise/subject_spec.rb
highrise-3.1.0 spec/highrise/subject_spec.rb
highrise-3.1.0.pre spec/highrise/subject_spec.rb
highrise-3.0.5 spec/highrise/subject_spec.rb
highrise-3.0.4 spec/highrise/subject_spec.rb
highrise-3.0.3 spec/highrise/subject_spec.rb
peterosullivan-highrise-3.0.7 spec/highrise/subject_spec.rb
peterosullivan-highrise-3.0.6 spec/highrise/subject_spec.rb
peterosullivan-highrise-3.0.5 spec/highrise/subject_spec.rb
peterosullivan-highrise-3.0.4 spec/highrise/subject_spec.rb
peterosullivan-highrise-3.0.3 spec/highrise/subject_spec.rb
peterosullivan-highrise-3.0.2 spec/highrise/subject_spec.rb
highrise-3.0.1 spec/highrise/subject_spec.rb
highrise-3.0.0 spec/highrise/subject_spec.rb