Sha256: f92f0b2a71b3349b4ca57205fc56d643eb5d09b9442d42c711fe2fd23fa59d33

Contents?: true

Size: 649 Bytes

Versions: 9

Compression:

Stored size: 649 Bytes

Contents

require 'rails_helper'

module BloomRemit
  module Txns
    RSpec.describe HandleResponse do

      let(:remote_response) do
        build(:bloom_remit_client_create_payment_response, {
          body: {"i" => "am body"},
        })
      end
      let(:txn) { create(:txn) }

      it "saves the response" do
        resulting_ctx = described_class.
          execute(txn: txn, remote_response: remote_response)
        expect(txn.responses.count).to eq 1
        expect(txn.responses.first).to eq resulting_ctx.response
        response = resulting_ctx.response
        expect(response.body).to eq({"i" => "am body"})
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bloom_remit-0.6.1 spec/services/bloom_remit/txns/handle_response_spec.rb
bloom_remit-0.6.0 spec/services/bloom_remit/txns/handle_response_spec.rb
bloom_remit-0.5.0 spec/services/bloom_remit/txns/handle_response_spec.rb
bloom_remit-0.4.1 spec/services/bloom_remit/txns/handle_response_spec.rb
bloom_remit-0.4.0 spec/services/bloom_remit/txns/handle_response_spec.rb
bloom_remit-0.3.0 spec/services/bloom_remit/txns/handle_response_spec.rb
bloom_remit-0.2.1 spec/services/bloom_remit/txns/handle_response_spec.rb
bloom_remit-0.2.0 spec/services/bloom_remit/txns/handle_response_spec.rb
bloom_remit-0.1.0 spec/services/bloom_remit/txns/handle_response_spec.rb