Sha256: 08f1e70be389f80e0b86662dac8ea6e27bc4a877931bbd0ee722c42c3430cb3a

Contents?: true

Size: 864 Bytes

Versions: 2

Compression:

Stored size: 864 Bytes

Contents

require 'test_helper'

module Workarea
  module Storefront
    module GlobalEAPi
      class UpdateOrderStatusIntegrationTest < Workarea::IntegrationTest
        include GlobalESupport

        def test_successful_canceled_order_post
          order = create_global_e_completed_checkout

          post storefront.globale_update_order_status_path,
            headers: { 'CONTENT_TYPE' => 'application/json' },
            params: global_e_update_order_status_body(global_e_order_id: order.global_e_id)

          assert response.ok?

          order.reload
          assert order.canceled?
          assert_equal :canceled, order.status

          api_events = GlobalE::OrderApiEvents.find(order.id)
          assert api_events.update_order_status.present?
          assert api_events.update_order_status_response.present?
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
workarea-global_e-1.3.0 test/integration/workarea/storefront/global_e_api/update_order_status_integration_test.rb
workarea-global_e-1.2.1 test/integration/workarea/storefront/global_e_api/update_order_status_integration_test.rb