Sha256: 4afda9277394f3d19a767e4cae9b0cdcd05bc5e1457f70cc9ff13b6003ca7331

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

require 'test_helper'

module Workarea
  module Admin
    class ForterOrderIntegrationTest < Workarea::IntegrationTest
      include Admin::IntegrationTest

      def test_shows_decision
        order = create_placed_forter_order(email: 'approve@workarea.com')

        get admin.order_path(order)
        assert(response.body.include?("approve"))
      end

      def test_shows_error_decision
        order = create_placed_forter_order(email: 'error@workarea.com')

        get admin.fraud_order_path(order)
        message = order.fraud_decision.response.errors.first["message"]
        assert(response.body.include?(message))
      end

      def test_returns_forter_order_details
        order = create_placed_forter_order(email: 'approve@workarea.com')
        decision = order.fraud_decision
        get admin.fraud_order_path(order)

        assert(response.body.include?(decision.response.body_message))
        assert(response.body.include?(decision.response.action))
        assert(response.body.include?(decision.response.reason_code.to_s))
        assert(response.body.include?(decision.external_order_status))
        assert(response.body.include?(t('workarea.admin.orders.forter.console')))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
workarea-forter-1.3.2 test/integration/workarea/admin/forter_order_integration_test.rb
workarea-forter-1.3.1 test/integration/workarea/admin/forter_order_integration_test.rb
workarea-forter-1.3.0 test/integration/workarea/admin/forter_order_integration_test.rb