Browse Source

Add test to fetch all transactions

Fixture update
Kris Penney 6 years ago
parent
commit
5cd5ec5bd8
2 changed files with 4 additions and 2 deletions
  1. 1 1
      test/fixtures/tender_transactions.json
  2. 3 1
      test/tender_transaction_test.rb

+ 1 - 1
test/fixtures/tender_transactions.json

@@ -44,7 +44,7 @@
       "remote_reference": "1118368",
       "payment_method": "credit_card",
       "payment_details": {
-        "credit_card_number": "•••• •••• •••• 2",
+        "credit_card_number": "•••• •••• •••• 3",
         "credit_card_company": "Bogus"
       }
     }

+ 3 - 1
test/tender_transaction_test.rb

@@ -5,12 +5,14 @@ require 'test_helper'
 class TenderTransactionTest < Test::Unit::TestCase
   def setup
     super
-    fake "/tender_transactions.json", method: :get, body: load_fixture('tender_transactions')
+    fake "tender_transactions", method: :get, body: load_fixture('tender_transactions')
   end
 
   context "Tender Transaction" do
     should 'return a list of transactions' do
       tender_transactions = ShopifyAPI::TenderTransaction.all
+      assert_equal 3, tender_transactions.length
+      assert_equal [1, 2, 3], tender_transactions.map(&:id)
     end
   end
 end