Sha256: 779358c4326e0a1cc1c0f54127a4618f60aef0759497559d8c1923c31ead6f8e

Contents?: true

Size: 647 Bytes

Versions: 5

Compression:

Stored size: 647 Bytes

Contents

require 'test_helper'

module Workarea
  module Klarna
    class Gateway
      class CaptureRequestTest < TestCase
        def tender
          OpenStruct.new(payment: nil, order_id: '123')
        end

        def test_details
          request = CaptureRequest.new(tender, 5.to_m)

          assert_equal('post', request.method)
          assert_equal('/ordermanagement/v1/orders/123/captures', request.path)
          assert(request.summary.present?)
        end

        def test_body
          request = CaptureRequest.new(tender, 5.to_m)
          assert_equal({ captured_amount: 500 }, request.body)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
workarea-klarna-1.1.0 test/lib/workarea/klarna/gateway/capture_request_test.rb
workarea-klarna-1.1.0.beta1 test/lib/workarea/klarna/gateway/capture_request_test.rb
workarea-klarna-1.0.0 test/lib/workarea/klarna/gateway/capture_request_test.rb
workarea-klarna-1.0.0.beta2 test/lib/workarea/klarna/gateway/capture_request_test.rb
workarea-klarna-1.0.0.beta1 test/lib/workarea/klarna/gateway/capture_request_test.rb