Sha256: 02d293f23604917f06f52e8fb6506e782c6858a6f62adb0948928b93493749cf
Contents?: true
Size: 866 Bytes
Versions: 14
Compression:
Stored size: 866 Bytes
Contents
describe QuizApiClient::Services::BankService do let(:host) { 'api.host' } let(:config) { QuizApiClient::Config.new { |c| c.host = host } } let(:subject) { described_class.new(config) } describe '#show' do let(:params) { { id: 1 } } let(:stubbed_response) { { 'id' => 1, 'title' => 'some title' } } let(:expected_url) { "https://#{host}/api/internal_services/banks/#{params[:id]}" } let(:status_code) { 200 } before do stub_request(:get, expected_url) .to_return( status: status_code, body: stubbed_response.to_json, headers: { 'Content-Type' => 'application/json' } ) end it 'gets from quiz_api/api/banks and returns the response' do result = subject.show(params: params, token: 'token') expect(result.parsed_response).to eql(stubbed_response) end end end
Version data entries
14 entries across 14 versions & 1 rubygems