spec/useless/doc/client_spec.rb in useless-doc-0.4.0 vs spec/useless/doc/client_spec.rb in useless-doc-0.5.0
- old
+ new
@@ -9,11 +9,11 @@
end
it 'should make a normal request if the cache is empty.' do
Typhoeus.should_receive(:options).
with('http://some-api.granmal.com/some/resource', headers: { 'Accept' => 'application/json' }).
- and_return(mock(:response, response_code: 200, response_body: load_document('twonk.json').read))
+ and_return(mock(:response, response_code: 200, response_body: load_document('resource.json').read))
resource = @client.get('http://some-api.granmal.com/some/resource')
resource.path.should == '/twonks/:id'
end
@@ -30,11 +30,11 @@
now = Time.now
Time.should_receive(:now).once.and_return(now)
Typhoeus.should_receive(:options).once.
with('http://some-api.granmal.com/some/resource', headers: { 'Accept' => 'application/json' }).
- and_return(mock(:response, response_code: 200, response_body: load_document('twonk.json').read))
+ and_return(mock(:response, response_code: 200, response_body: load_document('resource.json').read))
Typhoeus.should_receive(:options).once.
with('http://some-api.granmal.com/some/resource', headers: { 'Accept' => 'application/json', 'If-Modified-Since' => now.httpdate}).
and_return(mock(:response, response_code: 304, response_body: ''))
@@ -45,10 +45,10 @@
end
describe Useless::Doc::Client::Stub do
it 'should serve files from the spec/documents directory' do
client = Useless::Doc::Client.stub
- resource = client.get('http://anything.useless.io/twonk')
+ resource = client.get('http://anything.useless.io/resource')
resource.path.should == '/twonks/:id'
end
it 'should return nil if the corresponding file doesn\'t exist' do
client = Useless::Doc::Client.stub
\ No newline at end of file