Sha256: 4e514d9e901208e425a91cc35c27f1469830b7a48dc44a4578dfa967f2cd7b91

Contents?: true

Size: 1.25 KB

Versions: 12

Compression:

Stored size: 1.25 KB

Contents

shared_examples 'available http request methods' do
  it "instantiates a new Request object" do
    VCR.use_cassette("client/#{http_method}/request") do
      expect(Myfinance::Request).to receive(:new).with({ body: params, method: http_method, token: "b552dd5a8598ca089b91c5e355a83b86e4696aefac9eaa05", url: "#{Myfinance.configuration.url}#{url}", user_agent: "Myfinance Ruby Client v#{Myfinance::VERSION}", account_id: account_id }).and_call_original
      subject.send(http_method, url, body: params)
    end
  end

  it 'runs the request' do
    VCR.use_cassette("client/#{http_method}/request") do
      expect_any_instance_of(Myfinance::Request).to receive(:run).and_call_original
      subject.send(http_method, url, body: params)
    end
  end

  it 'instantiates a new Response object' do
    VCR.use_cassette("client/#{http_method}/request") do
      expect(Myfinance::Response).to receive(:new).and_call_original
      subject.send(http_method, url, body: params)
    end
  end

  it 'resolves the response of the request a new Response object' do
    VCR.use_cassette("client/#{http_method}/request") do
      expect_any_instance_of(Myfinance::Response).to receive(:resolve!).and_call_original
      subject.send(http_method, url, body: params)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
myfinance-1.2.1 spec/support/shared_examples/http_request_methods.rb
myfinance-1.2.0 spec/support/shared_examples/http_request_methods.rb
myfinance-1.1.0 spec/support/shared_examples/http_request_methods.rb
myfinance-1.0.0 spec/support/shared_examples/http_request_methods.rb
myfinance-0.7.0 spec/support/shared_examples/http_request_methods.rb
myfinance-0.6.0 spec/support/shared_examples/http_request_methods.rb
myfinance-0.5.0 spec/support/shared_examples/http_request_methods.rb
myfinance-0.4.0 spec/support/shared_examples/http_request_methods.rb
myfinance-0.3.3 spec/support/shared_examples/http_request_methods.rb
myfinance-0.3.2 spec/support/shared_examples/http_request_methods.rb
myfinance-0.3.1 spec/support/shared_examples/http_request_methods.rb
myfinance-0.3.0 spec/support/shared_examples/http_request_methods.rb