Sha256: 1b1848283ee02615aa5477d9afaef84da33236fd35b3234da8f94b3142f8d8af

Contents?: true

Size: 985 Bytes

Versions: 4

Compression:

Stored size: 985 Bytes

Contents

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

describe Highrise::Company do

  before(:each) do
    @company = Highrise::Company.new
  end
  
  it "should be instance of Highrise::Base" do
    @company.kind_of?(Highrise::Base).should be_true
  end
  
  describe ".find_all_across_pages_since" do
    
    it "should delegate to find_all_across_pages with correct params" do
      time = Time.parse("Wed Jan 14 15:43:11 -0200 2009")
      Highrise::Company.should_receive(:find_all_across_pages).with({:params=>{:since=>"20090114154311"}}).and_return("result")
      Highrise::Company.find_all_across_pages_since(time).should == "result"
    end

  end
  
  describe "people" do

    it "should delegate to Highrise::Person.find with correct params" do
      @company.should_receive(:id).and_return(1)
      Highrise::Person.should_receive(:find).with(:all, {:from=>"/companies/1/people.xml"}).and_return("people")
      @company.people.should == "people"
    end

  end


end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
slainer68-highrise-0.6.1 spec/highrise/company_spec.rb
slainer68-highrise-0.6.2 spec/highrise/company_spec.rb
slainer68-highrise-0.6 spec/highrise/company_spec.rb
tapajos-highrise-0.6 spec/highrise/company_spec.rb