Files
fizzy/test/models/identity/joinable_test.rb
T
Stanko K.R. e3d91f4ba2 Fix join codes skipping user setup
If someone joined an account with the same identity as they were signed in with the old logic would skip the user setup step
2025-11-27 17:59:17 +01:00

26 lines
686 B
Ruby

require "test_helper"
class Identity::JoinableTest < ActiveSupport::TestCase
test "join" do
identity = identities(:david)
user = identity.join(accounts(:initech))
assert_kind_of User, user
assert_equal accounts(:initech), user.account
assert_equal identity.email_address, user.name
identity = identities(:mike)
user = identity.join(accounts("37s"), name: "Mike")
assert_kind_of User, user
assert_equal accounts("37s"), user.account
assert_equal "Mike", user.name
end
test "member_of?" do
identity = identities(:david)
assert identity.member_of?(accounts("37s"))
assert_not identity.member_of?(accounts(:initech))
end
end