test/test_cache.rb in rest-graph-1.5.0 vs test/test_cache.rb in rest-graph-1.6.0
- old
+ new
@@ -5,24 +5,24 @@
require File.dirname(__FILE__) + '/common'
end
describe RestGraph do
after do
- reset_webmock
+ WebMock.reset_webmock
RR.verify
end
- it 'would enable cache if passing cache' do
+ should 'enable cache if passing cache' do
url, body = "https://graph.facebook.com/cache", '{"message":"ok"}'
stub_request(:get, url).to_return(:body => body).times(1)
cache = {}
rg = RestGraph.new(:cache => cache, :auto_decode => false)
3.times{ rg.get('cache').should == body }
cache.should == {rg.send(:cache_key, url) => body}
end
- it 'would not cache post/put/delete' do
+ should 'not cache post/put/delete' do
[:put, :post, :delete].each{ |meth|
url, body = "https://graph.facebook.com/cache", '{"message":"ok"}'
stub_request(meth, url).to_return(:body => body).times(3)
cache = {}