mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-21 14:19:39 +02:00
Use consistent language for invite codes
This commit is contained in:
parent
8118927f9b
commit
3852b79121
3 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
namespace :invites do
|
namespace :invites do
|
||||||
desc "Create an invitation code"
|
desc "Create an invite code"
|
||||||
task create: :environment do
|
task create: :environment do
|
||||||
puts InviteCode.generate!
|
puts InviteCode.generate!
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
|
||||||
assert_redirected_to root_url
|
assert_redirected_to root_url
|
||||||
end
|
end
|
||||||
|
|
||||||
test "create when hosted requires an invitation code" do
|
test "create when hosted requires an invite code" do
|
||||||
ENV["HOSTED"] = "true"
|
ENV["HOSTED"] = "true"
|
||||||
|
|
||||||
assert_no_difference "User.count" do
|
assert_no_difference "User.count" do
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require "test_helper"
|
require "test_helper"
|
||||||
|
|
||||||
class InviteCodeTest < ActiveSupport::TestCase
|
class InviteCodeTest < ActiveSupport::TestCase
|
||||||
test "claim! destroys the invitation token" do
|
test "claim! destroys the invite token" do
|
||||||
code = InviteCode.generate!
|
code = InviteCode.generate!
|
||||||
|
|
||||||
assert_difference "InviteCode.count", -1 do
|
assert_difference "InviteCode.count", -1 do
|
||||||
|
@ -17,7 +17,7 @@ class InviteCodeTest < ActiveSupport::TestCase
|
||||||
assert_not InviteCode.claim!("invalid")
|
assert_not InviteCode.claim!("invalid")
|
||||||
end
|
end
|
||||||
|
|
||||||
test "generate! creates a new invitation and returns its token" do
|
test "generate! creates a new invite and returns its token" do
|
||||||
assert_difference "InviteCode.count", +1 do
|
assert_difference "InviteCode.count", +1 do
|
||||||
assert_equal InviteCode.generate!, InviteCode.last.token
|
assert_equal InviteCode.generate!, InviteCode.last.token
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue