Skip to content

Commit

Permalink
Update deprecated stub! to stub in PageResponseCacheDirectorSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
jomz committed Feb 12, 2014
1 parent ff67409 commit 6cf9c95
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spec/models/radiant/page_response_cache_director_spec.rb
Expand Up @@ -25,8 +25,8 @@
let(:non_cacheable_params){ {:private => true, "no-cache" => true} }
let(:cacheable_params){ {:public => true, :private => false} }
let(:listener){ l = OpenStruct.new()
l.stub!(:set_etag)
l.stub!(:set_expiry)
l.stub(:set_etag)
l.stub(:set_expiry)
l
}
let(:page){ OpenStruct.new }
Expand All @@ -44,8 +44,8 @@
end

it 'sets the cacheable response to the default timeout' do
listener.stub!(:cacheable_request?).and_return(true)
page.stub!(:cache?).and_return(true)
listener.stub(:cacheable_request?).and_return(true)
page.stub(:cache?).and_return(true)

director = described_class.new(page, listener)

Expand All @@ -54,9 +54,9 @@
end

it 'sets the cacheable response to the page timeout' do
listener.stub!(:cacheable_request?).and_return(true)
page.stub!(:cache?).and_return(true)
page.stub!(:cache_timeout).and_return(14.days)
listener.stub(:cacheable_request?).and_return(true)
page.stub(:cache?).and_return(true)
page.stub(:cache_timeout).and_return(14.days)

director = described_class.new(page, listener)

Expand All @@ -65,16 +65,16 @@
end

it 'is not cacheable if the listener request is not cacheable' do
listener.stub!(:cacheable_request?).and_return(false)
listener.stub(:cacheable_request?).and_return(false)
director = described_class.new(page, listener)

listener.should_receive(:set_expiry).with(nil, non_cacheable_params)
director.set_cache_control
end

it 'is not cacheable if the page is not cacheable' do
listener.stub!(:cacheable_request?).and_return(true)
page.stub!(:cache?).and_return(false)
listener.stub(:cacheable_request?).and_return(true)
page.stub(:cache?).and_return(false)
director = described_class.new(page, listener)

listener.should_receive(:set_expiry).with(nil, non_cacheable_params)
Expand Down

0 comments on commit 6cf9c95

Please sign in to comment.