Sha256: f1126e934b9fbf7e8a72d29909a8e410166df133051942a0e642502eec4d5d30

Contents?: true

Size: 1.3 KB

Versions: 15

Compression:

Stored size: 1.3 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

15 entries across 15 versions & 1 rubygems

Version Path
myfinance-1.8.2 spec/support/shared_examples/http_request_methods.rb
myfinance-1.8.1 spec/support/shared_examples/http_request_methods.rb
myfinance-1.8.0 spec/support/shared_examples/http_request_methods.rb
myfinance-1.7.0 spec/support/shared_examples/http_request_methods.rb
myfinance-1.6.6 spec/support/shared_examples/http_request_methods.rb
myfinance-1.6.5 spec/support/shared_examples/http_request_methods.rb
myfinance-1.6.4 spec/support/shared_examples/http_request_methods.rb
myfinance-1.6.3 spec/support/shared_examples/http_request_methods.rb
myfinance-1.6.1 spec/support/shared_examples/http_request_methods.rb
myfinance-1.6.0 spec/support/shared_examples/http_request_methods.rb
myfinance-1.5.0 spec/support/shared_examples/http_request_methods.rb
myfinance-1.4.1 spec/support/shared_examples/http_request_methods.rb
myfinance-1.4.0 spec/support/shared_examples/http_request_methods.rb
myfinance-1.3.1 spec/support/shared_examples/http_request_methods.rb
myfinance-1.3.0 spec/support/shared_examples/http_request_methods.rb