Sha256: 79a2e817b6e47d291ea41181ae71767d449fb52e17b2206cd110a39c8653df74

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

describe Highrise::Kase do
  it { should be_a_kind_of Highrise::Subject }

  it_should_behave_like "a paginated class"

  it "#close!" do
    mocked_now = Time.parse("Wed Jan 14 15:43:11 -0200 2009")
    Time.should_receive(:now).and_return(mocked_now)
    subject.should_receive(:update_attribute).with(:closed_at, mocked_now.utc)
    subject.close!
  end

  it "#open!" do
    subject.should_receive(:update_attribute).with(:closed_at, nil)
    subject.open!
  end

  it ".all_open_across_pages" do
    subject.class.should_receive(:find).with(:all,{:from=>"/kases/open.xml",:params=>{:n=>0}}).and_return(["things"])
    subject.class.should_receive(:find).with(:all,{:from=>"/kases/open.xml",:params=>{:n=>1}}).and_return([])
    subject.class.all_open_across_pages.should == ["things"]
  end

  it ".all_closed_across_pages" do
    subject.class.should_receive(:find).with(:all,{:from=>"/kases/closed.xml",:params=>{:n=>0}}).and_return(["things"])
    subject.class.should_receive(:find).with(:all,{:from=>"/kases/closed.xml",:params=>{:n=>1}}).and_return([])
    subject.class.all_closed_across_pages.should == ["things"]
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
highrise-3.2.3 spec/highrise/kase_spec.rb
highrise-3.2.1 spec/highrise/kase_spec.rb
highrise-3.1.6 spec/highrise/kase_spec.rb
highrise-3.1.5 spec/highrise/kase_spec.rb
highrise-3.1.2 spec/highrise/kase_spec.rb
highrise-3.1.1 spec/highrise/kase_spec.rb
highrise-3.1.0 spec/highrise/kase_spec.rb
highrise-3.1.0.pre spec/highrise/kase_spec.rb
highrise-3.0.5 spec/highrise/kase_spec.rb
highrise-3.0.4 spec/highrise/kase_spec.rb
highrise-3.0.3 spec/highrise/kase_spec.rb