fix: raise and check for errors correctly

Amolith created

Replace incorrect `CreditCardSale::TooLowError` and
`CreditCardSale::TooHighError` with correct `AmountTooLowError` and
`AmountTooHighError` respectively.

Change summary

lib/buy_account_credit_form.rb       | 4 ++--
test/test_buy_account_credit_form.rb | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

Detailed changes

lib/buy_account_credit_form.rb 🔗

@@ -53,9 +53,9 @@ class BuyAccountCreditForm
 		amount_value = amount.to_f
 
 		if amount_value < 15
-			raise CreditCardSale::TooLowError
+			raise AmountTooLowError.new(amount_value, 15)
 		elsif amount_value > @max_top_up_amount
-			raise CreditCardSale::TooHighError
+			raise AmountTooHighError.new(amount_value, @max_top_up_amount)
 		end
 
 		{

test/test_buy_account_credit_form.rb 🔗

@@ -101,7 +101,7 @@ class BuyAccountCreditFormTest < Minitest::Test
 			{ var: "payment_method", value: "0" },
 			{ var: "amount", value: "10" }
 		]
-		assert_raises(CreditCardSale::TooLowError) do
+		assert_raises(AmountTooLowError) do
 			@form.parse(iq_form)
 		end
 	end
@@ -112,7 +112,7 @@ class BuyAccountCreditFormTest < Minitest::Test
 			{ var: "payment_method", value: "0" },
 			{ var: "amount", value: "200" }
 		]
-		assert_raises(CreditCardSale::TooHighError) do
+		assert_raises(AmountTooHighError) do
 			@form.parse(iq_form)
 		end
 	end