Sha256: 565c281f756adee9b32e6d3a48f78da45ec2cab2b2437a248eb3238ad44ed6e0

Contents?: true

Size: 1.28 KB

Versions: 16

Compression:

Stored size: 1.28 KB

Contents

require 'test_helper'
require 'workarea/api/documentation_test'

module Workarea
  module Api
    module Admin
      class PaymentTransactionsDocumentationTest < DocumentationTest
        include Workarea::Admin::IntegrationTest

        resource 'Payment transactions'

        def test_and_document_index
          description 'Listing payment transactions'
          route admin_api.payment_transactions_path
          parameter :page, 'Current page'
          parameter :sort_by, 'Field on which to sort (see responses for possible values)'
          parameter :sort_direction, 'Direction to sort (asc or desc)'

          2.times { |i| create_placed_order(id: 1000 + i) }

          record_request do
            get admin_api.payment_transactions_path,
                  params: { page: 1, sort_by: 'created_at', sort_direction: 'desc' }

            assert_equal(200, response.status)
          end
        end

        def test_and_document_show
          description 'Showing a payment transaction'
          route admin_api.payment_transaction_path(':id')

          create_placed_order

          record_request do
            get admin_api.payment_transaction_path(Payment::Transaction.first.id)
            assert_equal(200, response.status)
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
workarea-api-4.5.6 admin/test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-admin-4.5.6 test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-4.5.5 admin/test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-admin-4.5.5 test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-4.5.4 admin/test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-admin-4.5.4 test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-4.5.3 admin/test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-admin-4.5.3 test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-4.5.2 admin/test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-admin-4.5.2 test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-4.5.0 admin/test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-admin-4.5.0 test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-4.4.7 admin/test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-admin-4.4.7 test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-4.4.6 admin/test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb
workarea-api-admin-4.4.6 test/documentation/workarea/api/admin/payment_transactions_documentation_test.rb