File tree Expand file tree Collapse file tree 7 files changed +15
-25
lines changed
Expand file tree Collapse file tree 7 files changed +15
-25
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def create
1818 if identity == Current . identity && user . setup?
1919 redirect_to landing_url ( script_name : @join_code . account . slug )
2020 elsif identity == Current . identity
21- redirect_to new_users_verification_url ( script_name : @join_code . account . slug )
21+ redirect_to new_users_join_url ( script_name : @join_code . account . slug )
2222 else
2323 logout_and_send_new_magic_link ( identity )
2424 redirect_to session_magic_link_url ( script_name : nil )
@@ -44,6 +44,6 @@ def logout_and_send_new_magic_link(identity)
4444 magic_link = identity . send_magic_link
4545 serve_development_magic_link ( magic_link )
4646
47- session [ :return_to_after_authenticating ] = new_users_verification_url ( script_name : @join_code . account . slug )
47+ session [ :return_to_after_authenticating ] = new_users_join_url ( script_name : @join_code . account . slug )
4848 end
4949end
Original file line number Diff line number Diff line change 11class Users ::VerificationsController < ApplicationController
2- layout "public"
3-
4- def new
5- end
6-
72 def create
83 Current . user . verify
9- redirect_to new_users_join_path
4+ head :ok
105 end
116end
Original file line number Diff line number Diff line change 11<% @page_title = "Great! Now enter your name" %>
22
3+ <% if Current.user && !Current.user.verified? %>
4+ <div data-controller ="beacon " data-beacon-url-value ="<%= users_verifications_path %> "> </ div >
5+ <% end %>
6+
37< div class ="panel panel--centered flex flex-column gap-half ">
48 < h1 class ="txt-large font-weight-black margin-none "> <%= @page_title %> </ h1 >
59
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 138138
139139 namespace :users do
140140 resources :joins
141- resources :verifications , only : %i[ new create ]
141+ resources :verifications , only : %i[ create ]
142142 end
143143
144144 resource :session do
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class JoinCodesControllerTest < ActionDispatch::IntegrationTest
3636 end
3737
3838 assert_redirected_to session_magic_link_url ( script_name : nil )
39- assert_equal new_users_verification_url ( script_name : @account . slug ) , session [ :return_to_after_authenticating ]
39+ assert_equal new_users_join_url ( script_name : @account . slug ) , session [ :return_to_after_authenticating ]
4040 end
4141
4242 test "create for existing identity" do
@@ -55,7 +55,7 @@ class JoinCodesControllerTest < ActionDispatch::IntegrationTest
5555 assert_redirected_to landing_url ( script_name : @account . slug )
5656 end
5757
58- test "create for signed-in identity without a user in the account redirects to verification " do
58+ test "create for signed-in identity without a user in the account redirects to join " do
5959 identity = identities ( :mike )
6060 sign_in_as :mike
6161
@@ -67,6 +67,6 @@ class JoinCodesControllerTest < ActionDispatch::IntegrationTest
6767 end
6868 end
6969
70- assert_redirected_to new_users_verification_url ( script_name : @account . slug )
70+ assert_redirected_to new_users_join_url ( script_name : @account . slug )
7171 end
7272end
Original file line number Diff line number Diff line change 11require "test_helper"
22
33class Users ::VerificationsControllerTest < ActionDispatch ::IntegrationTest
4- test "new renders the auto-submit form" do
5- sign_in_as :david
6-
7- get new_users_verification_path
8-
9- assert_response :ok
10- end
11-
12- test "create verifies the user and redirects to join" do
13- sign_in_as :david
14-
4+ test "create verifies the user" do
155 user = users ( :david )
166 user . update_column ( :verified_at , nil )
7+ sign_in_as user
8+
179 assert_not user . verified?
1810
1911 post users_verifications_path
2012
21- assert_redirected_to new_users_join_path
13+ assert_response :ok
2214 assert user . reload . verified?
2315 end
2416end
You can’t perform that action at this time.
0 commit comments