spec/lib/hyperion/test_spec.rb in hyperion_http-0.5.0 vs spec/lib/hyperion/test_spec.rb in hyperion_http-0.6.0
- old
+ new
@@ -29,11 +29,11 @@
end
it 'implements specific routes' do
result = Hyperion.request(get_user_route)
expect_success(result, {'name' => 'freddy'})
- result = Hyperion.request(post_greeting_route, write({'name' => 'freddy'}, :json))
+ result = Hyperion.request(post_greeting_route, body: write({'name' => 'freddy'}, :json))
expect_success(result, {'greeting' => 'hello, freddy'})
end
it 'returns 404 if a requested route is not stubbed' do
bad_path = RestRoute.new(:get, 'http://somesite.org/abc', user_response_params)
bad_headers = RestRoute.new(:get, 'http://somesite.org/users/0', ResponseDescriptor.new('abc', 1, :json))
@@ -94,10 +94,10 @@
result = Hyperion.request(RestRoute.new(:get, 'http://somesite.org/users/0', user_response_params))
expect(result.body).to eql({'name' => 'freddy'})
result = Hyperion.request(RestRoute.new(:post, 'http://somesite.org/users/0',
user_response_params, PayloadDescriptor.new(:json)),
- write({'name' => 'annie'}, :json))
+ body: write({'name' => 'annie'}, :json))
expect(result.body).to eql({'updated' => {'name' => 'annie'}})
end
it 'considers the path to be part of the route' do
Hyperion.fake('http://somesite.org') do |svr|