request_method.rb 822 Bytes
Newer Older
1
shared_examples 'request method' do
2
  let(:ssoid)              { 'vnboeirubvyebvuekrybobvuiberlvbre' }
3 4
  let(:http_response)      { double(:http_response, code: '200', body: result_hash) }
  let(:result)             { BetfairApiNgRails::Api::Http::Responser.new(http_response) }
5
  let(:filter)             { BetfairApiNgRails::MarketFilter.new }
6
  let(:api_http_requester) { double(:api_http_requester, do_request: result, set_api_req_body: true, result: '') }
7 8

  before(:each) do
9
    allow(api_http_requester).to receive(:do_request).and_return result
Sergey Gernyak's avatar
Sergey Gernyak committed
10
    expect(BetfairApiNgRails::Api::SessionManager).to receive(:get_ssoid).and_return ssoid
11
    expect(BetfairApiNgRails::Api::Http::Factory).to receive(:provider_requester).and_return api_http_requester
12 13
  end

14
  subject { TestModule.send(method_name, parameters) }
15
end