4602cd3cdd
User are marked as verified after a join code is redeemed. The user is redirected to Users::VerificationsController, either: - after submitting a valid magic link code, - or immediately after redeeming the join code (if they're already authenticated with the correct identity) Account owners are automatically verified when the account is created (because they have already provided a magic link code at that point). This sets up for later commits that will backfill existing users and require verification before sending notification emails. Co-Authored-By: Claude <noreply@anthropic.com>
25 lines
537 B
Ruby
25 lines
537 B
Ruby
require "test_helper"
|
|
|
|
class Users::VerificationsControllerTest < ActionDispatch::IntegrationTest
|
|
test "new renders the auto-submit form" do
|
|
sign_in_as :david
|
|
|
|
get new_users_verification_path
|
|
|
|
assert_response :ok
|
|
end
|
|
|
|
test "create verifies the user and redirects to join" do
|
|
sign_in_as :david
|
|
|
|
user = users(:david)
|
|
user.update_column(:verified_at, nil)
|
|
assert_not user.verified?
|
|
|
|
post users_verifications_path
|
|
|
|
assert_redirected_to new_users_join_path
|
|
assert user.reload.verified?
|
|
end
|
|
end
|