Gemfile 🔗
@@ -34,7 +34,7 @@ group(:development) do
end
group(:test) do
- gem "minitest", "<= 5.15.0"
+ gem "minitest", ">= 5.16.0"
gem "rack-test"
gem "rake"
gem "rantly"
Stephen Paul Weber created
Gemfile | 2 +-
test/test_customer_info.rb | 2 +-
test/test_low_balance.rb | 8 ++++----
test/test_registration.rb | 2 +-
test/test_transaction.rb | 23 ++++++++++++-----------
test/test_web.rb | 36 ++++++++++++++++--------------------
6 files changed, 35 insertions(+), 38 deletions(-)
@@ -34,7 +34,7 @@ group(:development) do
end
group(:test) do
- gem "minitest", "<= 5.15.0"
+ gem "minitest", ">= 5.16.0"
gem "rack-test"
gem "rake"
gem "rantly"
@@ -75,7 +75,7 @@ class CustomerInfoTest < Minitest::Test
call_attempt_repo.expect(
:find_outbound,
CallAttempt::Unsupported.new(direction: :outbound),
- [cust, "+1", { call_id: "dry_run" }]
+ [cust, "+1"], call_id: "dry_run"
)
trust_repo = Minitest::Mock.new
@@ -131,7 +131,7 @@ class LowBalanceTest < Minitest::Test
LowBalance::AutoTopUp::Transaction.expect(
:sale,
tx,
- [@customer, { amount: 100 }]
+ [@customer], amount: 100
)
@auto_top_up.notify!
assert_mock tx
@@ -150,7 +150,7 @@ class LowBalanceTest < Minitest::Test
LowBalance::AutoTopUp::Transaction.expect(
:sale,
tx,
- [customer, { amount: 115 }]
+ [customer], amount: 115
)
auto_top_up.notify!
assert_mock tx
@@ -169,7 +169,7 @@ class LowBalanceTest < Minitest::Test
LowBalance::AutoTopUp::Transaction.expect(
:sale,
tx,
- [customer, { amount: 26 }]
+ [customer], amount: 26
)
auto_top_up.notify!
assert_mock tx
@@ -190,7 +190,7 @@ class LowBalanceTest < Minitest::Test
LowBalance::AutoTopUp::Transaction.expect(
:sale,
EMPromise.reject(RuntimeError.new("test")),
- [@customer, { amount: 100 }]
+ [@customer], amount: 100
)
@auto_top_up.notify!.sync
assert_mock @customer
@@ -435,7 +435,7 @@ class RegistrationTest < Minitest::Test
customer.expect(
:bill_plan,
nil,
- [{ note: "Bill +15555550000 for first month" }]
+ note: "Bill +15555550000 for first month"
)
Registration::Payment::CreditCard::Activate::Finish.expect(
:new,
@@ -33,7 +33,7 @@ class TransactionTest < Minitest::Test
TrustLevelRepo::DB.expect(
:query_one,
EMPromise.resolve({}),
- [String, "test", Hash]
+ [String, "test"], default: {}
)
CustomerFinancials::REDIS.expect(
:get,
@@ -57,9 +57,12 @@ class TransactionTest < Minitest::Test
EMPromise.resolve(
OpenStruct.new(success?: false, message: "declined")
),
- [Hash]
+ amount: 99,
+ merchant_account_id: "merchant_usd",
+ options: { submit_for_settlement: true },
+ payment_method_token: "token"
)
- assert_raises("declined") do
+ assert_raises(RuntimeError) do
Transaction.sale(
customer(plan_name: "test_usd"),
amount: 99,
@@ -87,7 +90,7 @@ class TransactionTest < Minitest::Test
TrustLevelRepo::DB.expect(
:query_one,
EMPromise.resolve({}),
- [String, "test", Hash]
+ [String, "test"], default: {}
)
CustomerFinancials::REDIS.expect(
:get,
@@ -122,7 +125,7 @@ class TransactionTest < Minitest::Test
TrustLevelRepo::DB.expect(
:query_one,
EMPromise.resolve({}),
- [String, "test", Hash]
+ [String, "test"], default: {}
)
CustomerFinancials::REDIS.expect(
:get,
@@ -139,12 +142,10 @@ class TransactionTest < Minitest::Test
transaction: FAKE_BRAINTREE_TRANSACTION
)
),
- [{
- amount: 99,
- payment_method_token: "token",
- merchant_account_id: "merchant_usd",
- options: { submit_for_settlement: true }
- }]
+ amount: 99,
+ payment_method_token: "token",
+ merchant_account_id: "merchant_usd",
+ options: { submit_for_settlement: true }
)
Transaction::REDIS.expect(
:setex,
@@ -161,7 +161,7 @@ class WebTest < Minitest::Test
EMPromise.resolve(
OpenStruct.new(insert: EMPromise.resolve(nil), total: 15)
),
- [Customer, { amount: 15 }]
+ [Customer], amount: 15
)
ExpiringLock::REDIS.expect(
@@ -291,16 +291,13 @@ class WebTest < Minitest::Test
CustomerFwd::BANDWIDTH_VOICE.expect(
:create_call,
OpenStruct.new(data: OpenStruct.new(call_id: "ocall")),
- [
- "test_bw_account",
- Matching.new do |arg|
- assert_equal(
- "http://example.org/inbound/calls/acall?customer_id=customerid",
- arg[:body].answer_url
- )
- assert_equal [:body], arg.keys
- end
- ]
+ ["test_bw_account"],
+ body: Matching.new do |arg|
+ assert_equal(
+ "http://example.org/inbound/calls/acall?customer_id=customerid",
+ arg.answer_url
+ )
+ end
)
post(
@@ -429,15 +426,14 @@ class WebTest < Minitest::Test
nil,
[
"test_bw_account",
- "bcall",
- Matching.new do |arg|
- assert_equal [:body], arg.keys
- assert_equal(
- "http://example.org/inbound/calls/oocall/voicemail",
- arg[:body].redirect_url
- )
- end
- ]
+ "bcall"
+ ],
+ body: Matching.new do |arg|
+ assert_equal(
+ "http://example.org/inbound/calls/oocall/voicemail",
+ arg.redirect_url
+ )
+ end
)
post(