Sha256: 901a978293e87181ef6e225b5ac2ae8c26e583d9f859827d3fe74e072a50eeca
Contents?: true
Size: 745 Bytes
Versions: 10
Compression:
Stored size: 745 Bytes
Contents
require 'rspec' require 'hyperion/requestor' require 'hyperion_test' describe 'fake_route' do include Hyperion::Requestor context 'for multipart form data as a part of the body' do let(:uri) { File.join('http://test.com', 'convert') } let(:response_descriptor) { ResponseDescriptor.new('converted_sample', 1, :json) } let(:route) { RestRoute.new(:post, uri, response_descriptor) } let(:response) { {'x' => 1} } it 'it fakes the given response' do fake_route(route, JSON.dump(response)) expect(make_request(route)).to eql response end def make_request(route) body = Multipart.new(file: File.open(File.expand_path('spec/fixtures/test'), 'r')) request(route, body: body) end end end
Version data entries
10 entries across 10 versions & 1 rubygems