braintree 4.14.0 → 4.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/lib/braintree/credit_card.rb +13 -0
  3. data/lib/braintree/credit_card_gateway.rb +15 -3
  4. data/lib/braintree/payment_method_gateway.rb +15 -3
  5. data/lib/braintree/test/nonce.rb +1 -0
  6. data/lib/braintree/test/venmo_sdk.rb +2 -0
  7. data/lib/braintree/transaction/credit_card_details.rb +3 -0
  8. data/lib/braintree/transaction/local_payment_details.rb +2 -0
  9. data/lib/braintree/transaction.rb +5 -4
  10. data/lib/braintree/transaction_gateway.rb +15 -3
  11. data/lib/braintree/transaction_search.rb +6 -5
  12. data/lib/braintree/version.rb +1 -1
  13. data/lib/braintree/webhook_notification.rb +1 -0
  14. data/lib/braintree/webhook_testing_gateway.rb +17 -0
  15. data/spec/integration/braintree/add_on_spec.rb +9 -9
  16. data/spec/integration/braintree/address_spec.rb +69 -69
  17. data/spec/integration/braintree/advanced_search_spec.rb +45 -45
  18. data/spec/integration/braintree/apple_pay_spec.rb +8 -8
  19. data/spec/integration/braintree/client_api/client_token_spec.rb +15 -15
  20. data/spec/integration/braintree/credit_card_spec.rb +223 -223
  21. data/spec/integration/braintree/credit_card_verification_search_spec.rb +16 -16
  22. data/spec/integration/braintree/credit_card_verification_spec.rb +52 -52
  23. data/spec/integration/braintree/customer_search_spec.rb +20 -20
  24. data/spec/integration/braintree/customer_spec.rb +313 -313
  25. data/spec/integration/braintree/disbursement_spec.rb +2 -2
  26. data/spec/integration/braintree/discount_spec.rb +9 -9
  27. data/spec/integration/braintree/dispute_spec.rb +87 -87
  28. data/spec/integration/braintree/document_upload_spec.rb +17 -17
  29. data/spec/integration/braintree/error_codes_spec.rb +2 -2
  30. data/spec/integration/braintree/http_spec.rb +28 -28
  31. data/spec/integration/braintree/merchant_account_spec.rb +127 -127
  32. data/spec/integration/braintree/merchant_spec.rb +103 -103
  33. data/spec/integration/braintree/oauth_spec.rb +61 -61
  34. data/spec/integration/braintree/payment_method_nonce_spec.rb +73 -73
  35. data/spec/integration/braintree/payment_method_spec.rb +389 -389
  36. data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +78 -78
  37. data/spec/integration/braintree/paypal_account_spec.rb +38 -38
  38. data/spec/integration/braintree/plan_spec.rb +15 -15
  39. data/spec/integration/braintree/samsung_pay_card_spec.rb +65 -65
  40. data/spec/integration/braintree/sepa_direct_debit_account_spec.rb +51 -51
  41. data/spec/integration/braintree/settlement_batch_summary_spec.rb +11 -11
  42. data/spec/integration/braintree/subscription_spec.rb +364 -364
  43. data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
  44. data/spec/integration/braintree/test_transaction_spec.rb +19 -19
  45. data/spec/integration/braintree/transaction_line_item_spec.rb +6 -6
  46. data/spec/integration/braintree/transaction_search_spec.rb +198 -165
  47. data/spec/integration/braintree/transaction_spec.rb +1315 -1149
  48. data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -32
  49. data/spec/integration/braintree/us_bank_account_spec.rb +30 -30
  50. data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +18 -18
  51. data/spec/integration/braintree/us_bank_account_verification_spec.rb +33 -33
  52. data/spec/integration/braintree/visa_checkout_card_spec.rb +57 -57
  53. data/spec/spec_helper.rb +9 -8
  54. data/spec/unit/braintree/address_spec.rb +8 -8
  55. data/spec/unit/braintree/base_module_spec.rb +4 -4
  56. data/spec/unit/braintree/client_token_spec.rb +2 -2
  57. data/spec/unit/braintree/configuration_spec.rb +57 -57
  58. data/spec/unit/braintree/credentials_parser_spec.rb +6 -6
  59. data/spec/unit/braintree/credit_card_spec.rb +31 -29
  60. data/spec/unit/braintree/credit_card_verification_gateway_spec.rb +28 -28
  61. data/spec/unit/braintree/credit_card_verification_search_spec.rb +9 -9
  62. data/spec/unit/braintree/credit_card_verification_spec.rb +17 -17
  63. data/spec/unit/braintree/customer_spec.rb +41 -40
  64. data/spec/unit/braintree/digest_spec.rb +5 -5
  65. data/spec/unit/braintree/disbursement_spec.rb +11 -11
  66. data/spec/unit/braintree/dispute_search_spec.rb +2 -2
  67. data/spec/unit/braintree/dispute_spec.rb +56 -56
  68. data/spec/unit/braintree/document_upload_spec.rb +8 -8
  69. data/spec/unit/braintree/enriched_customer_data_spec.rb +2 -2
  70. data/spec/unit/braintree/error_result_spec.rb +5 -5
  71. data/spec/unit/braintree/errors_spec.rb +9 -9
  72. data/spec/unit/braintree/http_spec.rb +8 -8
  73. data/spec/unit/braintree/local_payment_completed_spec.rb +11 -11
  74. data/spec/unit/braintree/local_payment_expired_spec.rb +2 -2
  75. data/spec/unit/braintree/local_payment_funded_spec.rb +6 -6
  76. data/spec/unit/braintree/merchant_account_spec.rb +4 -4
  77. data/spec/unit/braintree/modification_spec.rb +1 -1
  78. data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +6 -6
  79. data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +7 -7
  80. data/spec/unit/braintree/payment_method_nonce_details_spec.rb +14 -14
  81. data/spec/unit/braintree/payment_method_spec.rb +19 -19
  82. data/spec/unit/braintree/paypal_account_spec.rb +4 -4
  83. data/spec/unit/braintree/resource_collection_spec.rb +7 -7
  84. data/spec/unit/braintree/sepa_debit_account_nonce_details_spec.rb +1 -1
  85. data/spec/unit/braintree/sha256_digest_spec.rb +1 -1
  86. data/spec/unit/braintree/signature_service_spec.rb +2 -2
  87. data/spec/unit/braintree/subscription_search_spec.rb +17 -17
  88. data/spec/unit/braintree/subscription_spec.rb +8 -8
  89. data/spec/unit/braintree/successful_result_spec.rb +5 -5
  90. data/spec/unit/braintree/three_d_secure_info_spec.rb +20 -20
  91. data/spec/unit/braintree/transaction/credit_card_details_spec.rb +5 -5
  92. data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
  93. data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
  94. data/spec/unit/braintree/transaction/local_payment_details_spec.rb +30 -0
  95. data/spec/unit/braintree/transaction_gateway_spec.rb +9 -6
  96. data/spec/unit/braintree/transaction_search_spec.rb +2 -2
  97. data/spec/unit/braintree/transaction_spec.rb +101 -93
  98. data/spec/unit/braintree/unknown_payment_method_spec.rb +4 -4
  99. data/spec/unit/braintree/us_bank_account_spec.rb +2 -2
  100. data/spec/unit/braintree/us_bank_account_verification_search_spec.rb +7 -7
  101. data/spec/unit/braintree/us_bank_account_verification_spec.rb +7 -7
  102. data/spec/unit/braintree/util_spec.rb +27 -27
  103. data/spec/unit/braintree/validation_error_collection_spec.rb +34 -34
  104. data/spec/unit/braintree/validation_error_spec.rb +4 -4
  105. data/spec/unit/braintree/venmo_profile_data_spec.rb +5 -5
  106. data/spec/unit/braintree/webhook_notification_spec.rb +206 -191
  107. data/spec/unit/braintree/xml/libxml_spec.rb +5 -5
  108. data/spec/unit/braintree/xml/parser_spec.rb +8 -8
  109. data/spec/unit/braintree/xml/rexml_spec.rb +5 -5
  110. data/spec/unit/braintree/xml_spec.rb +17 -17
  111. data/spec/unit/braintree_spec.rb +2 -2
  112. metadata +3 -2
@@ -6,7 +6,7 @@ describe Braintree::CreditCardVerification, "search" do
6
6
  search.credit_card_cardholder_name.is "thisnameisnotreal"
7
7
  end
8
8
 
9
- collection.maximum_size.should == 0
9
+ expect(collection.maximum_size).to eq(0)
10
10
  end
11
11
 
12
12
  it "can search on text fields" do
@@ -33,14 +33,14 @@ describe Braintree::CreditCardVerification, "search" do
33
33
  search.id.is verification.id
34
34
  search.send(criterion).is value
35
35
  end
36
- collection.maximum_size.should == 1
37
- collection.first.id.should == verification.id
36
+ expect(collection.maximum_size).to eq(1)
37
+ expect(collection.first.id).to eq(verification.id)
38
38
 
39
39
  collection = Braintree::CreditCardVerification.search do |search|
40
40
  search.id.is verification.id
41
41
  search.send(criterion).is("invalid_attribute")
42
42
  end
43
- collection.should be_empty
43
+ expect(collection).to be_empty
44
44
  end
45
45
 
46
46
  collection = Braintree::CreditCardVerification.search do |search|
@@ -50,8 +50,8 @@ describe Braintree::CreditCardVerification, "search" do
50
50
  end
51
51
  end
52
52
 
53
- collection.maximum_size.should == 1
54
- collection.first.id.should == verification.id
53
+ expect(collection.maximum_size).to eq(1)
54
+ expect(collection.first.id).to eq(verification.id)
55
55
  end
56
56
 
57
57
  describe "multiple value fields" do
@@ -84,7 +84,7 @@ describe Braintree::CreditCardVerification, "search" do
84
84
  search.ids.in verification_id1, verification_id2
85
85
  end
86
86
 
87
- collection.maximum_size.should == 2
87
+ expect(collection.maximum_size).to eq(2)
88
88
  end
89
89
  end
90
90
 
@@ -112,24 +112,24 @@ describe Braintree::CreditCardVerification, "search" do
112
112
  )
113
113
  end
114
114
 
115
- collection.maximum_size.should == 1
116
- collection.first.id.should == verification.id
115
+ expect(collection.maximum_size).to eq(1)
116
+ expect(collection.first.id).to eq(verification.id)
117
117
 
118
118
  collection = Braintree::CreditCardVerification.search do |search|
119
119
  search.id.is verification.id
120
120
  search.created_at >= created_at - 1
121
121
  end
122
122
 
123
- collection.maximum_size.should == 1
124
- collection.first.id.should == verification.id
123
+ expect(collection.maximum_size).to eq(1)
124
+ expect(collection.first.id).to eq(verification.id)
125
125
 
126
126
  collection = Braintree::CreditCardVerification.search do |search|
127
127
  search.id.is verification.id
128
128
  search.created_at <= created_at + 1
129
129
  end
130
130
 
131
- collection.maximum_size.should == 1
132
- collection.first.id.should == verification.id
131
+ expect(collection.maximum_size).to eq(1)
132
+ expect(collection.first.id).to eq(verification.id)
133
133
 
134
134
  collection = Braintree::CreditCardVerification.search do |search|
135
135
  search.id.is verification.id
@@ -139,15 +139,15 @@ describe Braintree::CreditCardVerification, "search" do
139
139
  )
140
140
  end
141
141
 
142
- collection.maximum_size.should == 0
142
+ expect(collection.maximum_size).to eq(0)
143
143
 
144
144
  collection = Braintree::CreditCardVerification.search do |search|
145
145
  search.id.is verification.id
146
146
  search.created_at.is created_at
147
147
  end
148
148
 
149
- collection.maximum_size.should == 1
150
- collection.first.id.should == verification.id
149
+ expect(collection.maximum_size).to eq(1)
150
+ expect(collection.first.id).to eq(verification.id)
151
151
  end
152
152
  end
153
153
 
@@ -17,12 +17,12 @@ describe Braintree::CreditCardVerification, "search" do
17
17
 
18
18
  result = Braintree::CreditCardVerification.create(verification_params)
19
19
 
20
- result.should be_success
21
- result.credit_card_verification.id.should =~ /^\w{6,}$/
22
- result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::Verified
23
- result.credit_card_verification.processor_response_code.should == "1000"
24
- result.credit_card_verification.processor_response_text.should == "Approved"
25
- result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::Approved
20
+ expect(result).to be_success
21
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
22
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
23
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
24
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
25
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
26
26
  expect(result.credit_card_verification.network_transaction_id).not_to be_nil
27
27
  end
28
28
 
@@ -61,12 +61,12 @@ describe Braintree::CreditCardVerification, "search" do
61
61
 
62
62
  result = Braintree::CreditCardVerification.create(verification_params)
63
63
 
64
- result.success?.should == false
65
- result.credit_card_verification.id.should =~ /^\w{6,}$/
66
- result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::ProcessorDeclined
67
- result.credit_card_verification.processor_response_code.should == "2000"
68
- result.credit_card_verification.processor_response_text.should == "Do Not Honor"
69
- result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::SoftDeclined
64
+ expect(result.success?).to eq(false)
65
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
66
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::ProcessorDeclined)
67
+ expect(result.credit_card_verification.processor_response_code).to eq("2000")
68
+ expect(result.credit_card_verification.processor_response_text).to eq("Do Not Honor")
69
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::SoftDeclined)
70
70
  end
71
71
 
72
72
  it "returns validation errors" do
@@ -82,8 +82,8 @@ describe Braintree::CreditCardVerification, "search" do
82
82
 
83
83
  result = Braintree::CreditCardVerification.create(verification_params)
84
84
 
85
- result.success?.should == false
86
- result.errors.for(:verification).for(:options).first.code.should == Braintree::ErrorCodes::Verification::Options::AmountCannotBeNegative
85
+ expect(result.success?).to eq(false)
86
+ expect(result.errors.for(:verification).for(:options).first.code).to eq(Braintree::ErrorCodes::Verification::Options::AmountCannotBeNegative)
87
87
  end
88
88
 
89
89
  it "returns account type with debit" do
@@ -98,8 +98,8 @@ describe Braintree::CreditCardVerification, "search" do
98
98
  },
99
99
  )
100
100
 
101
- result.success?.should == true
102
- result.credit_card_verification.credit_card[:account_type].should == "debit"
101
+ expect(result.success?).to eq(true)
102
+ expect(result.credit_card_verification.credit_card[:account_type]).to eq("debit")
103
103
  end
104
104
 
105
105
  it "returns account type with credit" do
@@ -114,8 +114,8 @@ describe Braintree::CreditCardVerification, "search" do
114
114
  },
115
115
  )
116
116
 
117
- result.success?.should == true
118
- result.credit_card_verification.credit_card[:account_type].should == "credit"
117
+ expect(result.success?).to eq(true)
118
+ expect(result.credit_card_verification.credit_card[:account_type]).to eq("credit")
119
119
  end
120
120
 
121
121
  it "errors with unsupported account type" do
@@ -129,8 +129,8 @@ describe Braintree::CreditCardVerification, "search" do
129
129
  },
130
130
  )
131
131
 
132
- result.success?.should == false
133
- result.errors.for(:verification).for(:options).on(:account_type)[0].code.should == Braintree::ErrorCodes::Verification::Options::AccountTypeNotSupported
132
+ expect(result.success?).to eq(false)
133
+ expect(result.errors.for(:verification).for(:options).on(:account_type)[0].code).to eq(Braintree::ErrorCodes::Verification::Options::AccountTypeNotSupported)
134
134
  end
135
135
 
136
136
  it "errors with invalid account type" do
@@ -145,8 +145,8 @@ describe Braintree::CreditCardVerification, "search" do
145
145
  },
146
146
  )
147
147
 
148
- result.success?.should == false
149
- result.errors.for(:verification).for(:options).on(:account_type)[0].code.should == Braintree::ErrorCodes::Verification::Options::AccountTypeIsInvalid
148
+ expect(result.success?).to eq(false)
149
+ expect(result.errors.for(:verification).for(:options).on(:account_type)[0].code).to eq(Braintree::ErrorCodes::Verification::Options::AccountTypeIsInvalid)
150
150
  end
151
151
  end
152
152
 
@@ -162,8 +162,8 @@ describe Braintree::CreditCardVerification, "search" do
162
162
  credit_card_verification = Braintree::Customer.create(:credit_card => credit_card_params).credit_card_verification
163
163
  found_verification = Braintree::CreditCardVerification.find(credit_card_verification.id)
164
164
 
165
- found_verification.should == credit_card_verification
166
- found_verification.graphql_id.should_not be_nil
165
+ expect(found_verification).to eq(credit_card_verification)
166
+ expect(found_verification.graphql_id).not_to be_nil
167
167
  end
168
168
 
169
169
  it "raises a NotFoundError exception if verification cannot be found" do
@@ -215,7 +215,7 @@ describe Braintree::CreditCardVerification, "search" do
215
215
  search.status.in credit_card_verification.status
216
216
  end
217
217
 
218
- found_verifications.should include(credit_card_verification)
218
+ expect(found_verifications).to include(credit_card_verification)
219
219
  end
220
220
 
221
221
  it "searches and finds verifications using customer fields" do
@@ -231,7 +231,7 @@ describe Braintree::CreditCardVerification, "search" do
231
231
  search.payment_method_token.is credit_card.token
232
232
  end
233
233
 
234
- found_verifications.count.should eq(1)
234
+ expect(found_verifications.count).to eq(1)
235
235
  end
236
236
 
237
237
  describe "card type indicators" do
@@ -256,7 +256,7 @@ describe Braintree::CreditCardVerification, "search" do
256
256
  verification_id = search_results.first.id
257
257
 
258
258
  found_verification = Braintree::CreditCardVerification.find(verification_id)
259
- found_verification.credit_card[:prepaid].should == Braintree::CreditCard::Prepaid::Yes
259
+ expect(found_verification.credit_card[:prepaid]).to eq(Braintree::CreditCard::Prepaid::Yes)
260
260
  end
261
261
  end
262
262
  end
@@ -276,12 +276,12 @@ describe Braintree::CreditCardVerification, "search" do
276
276
 
277
277
  result = Braintree::CreditCardVerification.create(verification_params)
278
278
 
279
- result.should be_success
280
- result.credit_card_verification.id.should =~ /^\w{6,}$/
281
- result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::Verified
282
- result.credit_card_verification.processor_response_code.should == "1000"
283
- result.credit_card_verification.processor_response_text.should == "Approved"
284
- result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::Approved
279
+ expect(result).to be_success
280
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
281
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
282
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
283
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
284
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
285
285
  expect(result.credit_card_verification.network_transaction_id).not_to be_nil
286
286
  end
287
287
  end
@@ -309,12 +309,12 @@ describe Braintree::CreditCardVerification, "search" do
309
309
 
310
310
  result = Braintree::CreditCardVerification.create(verification_params)
311
311
 
312
- result.should be_success
313
- result.credit_card_verification.id.should =~ /^\w{6,}$/
314
- result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::Verified
315
- result.credit_card_verification.processor_response_code.should == "1000"
316
- result.credit_card_verification.processor_response_text.should == "Approved"
317
- result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::Approved
312
+ expect(result).to be_success
313
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
314
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
315
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
316
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
317
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
318
318
  expect(result.credit_card_verification.network_transaction_id).not_to be_nil
319
319
  end
320
320
 
@@ -326,7 +326,7 @@ describe Braintree::CreditCardVerification, "search" do
326
326
  :expiration_year => "2099",
327
327
  },
328
328
  )
329
- nonce.should_not be_nil
329
+ expect(nonce).not_to be_nil
330
330
 
331
331
  verification_params = {
332
332
  :credit_card => {
@@ -341,12 +341,12 @@ describe Braintree::CreditCardVerification, "search" do
341
341
 
342
342
  result = Braintree::CreditCardVerification.create(verification_params)
343
343
 
344
- result.should be_success
345
- result.credit_card_verification.id.should =~ /^\w{6,}$/
346
- result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::Verified
347
- result.credit_card_verification.processor_response_code.should == "1000"
348
- result.credit_card_verification.processor_response_text.should == "Approved"
349
- result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::Approved
344
+ expect(result).to be_success
345
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
346
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
347
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
348
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
349
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
350
350
  expect(result.credit_card_verification.network_transaction_id).not_to be_nil
351
351
  end
352
352
 
@@ -373,12 +373,12 @@ describe Braintree::CreditCardVerification, "search" do
373
373
 
374
374
  result = Braintree::CreditCardVerification.create(verification_params)
375
375
 
376
- result.should be_success
377
- result.credit_card_verification.id.should =~ /^\w{6,}$/
378
- result.credit_card_verification.status.should == Braintree::CreditCardVerification::Status::Verified
379
- result.credit_card_verification.processor_response_code.should == "1000"
380
- result.credit_card_verification.processor_response_text.should == "Approved"
381
- result.credit_card_verification.processor_response_type.should == Braintree::ProcessorResponseTypes::Approved
376
+ expect(result).to be_success
377
+ expect(result.credit_card_verification.id).to match(/^\w{6,}$/)
378
+ expect(result.credit_card_verification.status).to eq(Braintree::CreditCardVerification::Status::Verified)
379
+ expect(result.credit_card_verification.processor_response_code).to eq("1000")
380
+ expect(result.credit_card_verification.processor_response_text).to eq("Approved")
381
+ expect(result.credit_card_verification.processor_response_type).to eq(Braintree::ProcessorResponseTypes::Approved)
382
382
  expect(result.credit_card_verification.network_transaction_id).not_to be_nil
383
383
  end
384
384
  end
@@ -8,7 +8,7 @@ describe Braintree::Transaction, "search" do
8
8
  search.first_name.is "thisnameisnotreal"
9
9
  end
10
10
 
11
- collection.maximum_size.should == 0
11
+ expect(collection.maximum_size).to eq(0)
12
12
  end
13
13
 
14
14
  it "can search on text fields" do
@@ -69,14 +69,14 @@ describe Braintree::Transaction, "search" do
69
69
  search.send(criterion).is value
70
70
  end
71
71
 
72
- collection.maximum_size.should == 1
73
- collection.first.id.should == customer.id
72
+ expect(collection.maximum_size).to eq(1)
73
+ expect(collection.first.id).to eq(customer.id)
74
74
 
75
75
  collection = Braintree::Customer.search do |search|
76
76
  search.id.is customer.id
77
77
  search.send(criterion).is("invalid_attribute")
78
78
  end
79
- collection.should be_empty
79
+ expect(collection).to be_empty
80
80
  end
81
81
 
82
82
  collection = Braintree::Customer.search do |search|
@@ -86,8 +86,8 @@ describe Braintree::Transaction, "search" do
86
86
  end
87
87
  end
88
88
 
89
- collection.maximum_size.should == 1
90
- collection.first.id.should == customer.id
89
+ expect(collection.maximum_size).to eq(1)
90
+ expect(collection.first.id).to eq(customer.id)
91
91
  end
92
92
 
93
93
  it "can find duplicate credit cards for a give payment method token " do
@@ -111,8 +111,8 @@ describe Braintree::Transaction, "search" do
111
111
  search.payment_method_token_with_duplicates.is jim.credit_cards.first.token
112
112
  end
113
113
 
114
- collection.should include(jim)
115
- collection.should include(joe)
114
+ expect(collection).to include(jim)
115
+ expect(collection).to include(joe)
116
116
  end
117
117
 
118
118
  it "can search by created_at" do
@@ -122,7 +122,7 @@ describe Braintree::Transaction, "search" do
122
122
  )
123
123
 
124
124
  created_at = customer.created_at
125
- created_at.should be_utc
125
+ expect(created_at).to be_utc
126
126
 
127
127
  collection = Braintree::Customer.search do |search|
128
128
  search.company.is company
@@ -132,24 +132,24 @@ describe Braintree::Transaction, "search" do
132
132
  )
133
133
  end
134
134
 
135
- collection.maximum_size.should == 1
136
- collection.first.id.should == customer.id
135
+ expect(collection.maximum_size).to eq(1)
136
+ expect(collection.first.id).to eq(customer.id)
137
137
 
138
138
  collection = Braintree::Customer.search do |search|
139
139
  search.company.is customer.company
140
140
  search.created_at >= created_at - 1
141
141
  end
142
142
 
143
- collection.maximum_size.should == 1
144
- collection.first.company.should == customer.company
143
+ expect(collection.maximum_size).to eq(1)
144
+ expect(collection.first.company).to eq(customer.company)
145
145
 
146
146
  collection = Braintree::Customer.search do |search|
147
147
  search.company.is customer.company
148
148
  search.created_at <= created_at + 1
149
149
  end
150
150
 
151
- collection.maximum_size.should == 1
152
- collection.first.company.should == customer.company
151
+ expect(collection.maximum_size).to eq(1)
152
+ expect(collection.first.company).to eq(customer.company)
153
153
 
154
154
  collection = Braintree::Customer.search do |search|
155
155
  search.company.is customer.company
@@ -159,15 +159,15 @@ describe Braintree::Transaction, "search" do
159
159
  )
160
160
  end
161
161
 
162
- collection.maximum_size.should == 0
162
+ expect(collection.maximum_size).to eq(0)
163
163
 
164
164
  collection = Braintree::Customer.search do |search|
165
165
  search.company.is customer.company
166
166
  search.created_at.is created_at
167
167
  end
168
168
 
169
- collection.maximum_size.should == 1
170
- collection.first.company.should == customer.company
169
+ expect(collection.maximum_size).to eq(1)
170
+ expect(collection.first.company).to eq(customer.company)
171
171
  end
172
172
  end
173
173
 
@@ -189,7 +189,7 @@ describe Braintree::Transaction, "search" do
189
189
  search.id.is customer_id
190
190
  end
191
191
 
192
- collection.maximum_size.should == 1
193
- collection.first.should == customer
192
+ expect(collection.maximum_size).to eq(1)
193
+ expect(collection.first).to eq(customer)
194
194
  end
195
195
  end