lib/registration.rb 🔗 @@ -376,7 +376,7 @@ class Registration def guard_too_many_tries REDIS.get("jmp_invite_tries-#{@customer.customer_id}").then do |t| - raise Invalid, "Too many wrong attempts" if t > 10 + raise Invalid, "Too many wrong attempts" if t.to_i > 10 end end
test/test_registration.rb 🔗 @@ -354,7 +354,7 @@ class RegistrationTest < Minitest::Test customer = Customer.new("test", plan_name: "test_usd") Registration::Payment::InviteCode::REDIS.expect( :get, - EMPromise.resolve(0), + EMPromise.resolve(nil), ["jmp_invite_tries-test"] ) Registration::Payment::InviteCode::COMMAND_MANAGER.expect(