Remove upper bound on top up

Stephen Paul Weber created

It's wrong anyway, since trust levels impose different upper bounds, and
all we really care about here is min.

Change summary

lib/buy_account_credit_form.rb | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

Detailed changes

lib/buy_account_credit_form.rb 🔗

@@ -3,10 +3,7 @@
 class BuyAccountCreditForm
 	class AmountValidationError < StandardError
 		def initialize(amount)
-			super(
-				"amount #{amount} must be in the range " \
-				"#{RANGE.first} through #{RANGE.last}"
-			)
+			super("amount #{amount} must be more than $15")
 		end
 	end
 
@@ -21,20 +18,18 @@ class BuyAccountCreditForm
 		@payment_methods = payment_methods
 	end
 
-	RANGE = (15..1000).freeze
-
 	def form
 		FormTemplate.render(
 			:top_up,
 			balance: @balance,
 			payment_methods: @payment_methods,
-			range: RANGE
+			range: [15, nil]
 		)
 	end
 
 	def parse(form)
 		amount = form.field("amount")&.value&.to_s
-		raise AmountValidationError, amount unless RANGE.include?(amount.to_i)
+		raise AmountValidationError, amount unless amount.to_i >= 15
 
 		{
 			payment_method: @payment_methods.fetch(