Skip to content

Commit

Permalink
One more fix try
Browse files Browse the repository at this point in the history
  • Loading branch information
pyromaniac committed Mar 22, 2013
1 parent d845d4a commit 183b96e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spec/lib/liquid/tags/cache_spec.rb
Expand Up @@ -32,21 +32,23 @@

specify do
PufferPages.cache_store.should_receive(:write).with(
ActiveSupport::Cache.expand_cache_key(root), 'Hello', {}
ActiveSupport::Cache.expand_cache_key([root]), 'Hello', {}
).and_call_original
root.render("{% cache %}Hello{% endcache %}").should == 'Hello'
end

specify do
PufferPages.cache_store.stub(:read_entry).with(root.cache_key, {}) { entry }
PufferPages.cache_store.stub(:read_entry).with(
ActiveSupport::Cache.expand_cache_key([root]), {}
) { entry }
root.render("{% cache %}Hello{% endcache %}").should == entry.value
end
end

context 'additional params' do
specify do
PufferPages.cache_store.should_receive(:write).with(
ActiveSupport::Cache.expand_cache_key(root), 'Hello', { expires_in: 60 }
ActiveSupport::Cache.expand_cache_key([root]), 'Hello', { expires_in: 60 }
).and_call_original
root.render("{% cache expires_in: '1m' %}Hello{% endcache %}")
end
Expand Down Expand Up @@ -81,7 +83,7 @@

specify do
PufferPages.cache_store.should_receive(:write).with(
ActiveSupport::Cache.expand_cache_key(custom), 'Hello', {}
ActiveSupport::Cache.expand_cache_key([custom]), 'Hello', {}
).and_call_original
root.render("{% snippet 'custom' %}")
end
Expand Down

0 comments on commit 183b96e

Please sign in to comment.