Skip to content

Commit 53ef262

Browse files
committed
Allow email confirmation link to work as GET
1 parent 3725e45 commit 53ef262

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1>Complete your Joy of Rails registration</h1>
22

33
<p>
4-
<%= link_to "Confirm your email address", edit_users_confirmation_url(@confirmation_token) %>.
4+
<%= link_to "Confirm your email address", confirm_users_confirmation_url(@confirmation_token) %>.
55
</p>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Complete your Joy of Rails registration
22

3-
Follow this link to confirm your email address: <%= edit_users_confirmation_url(@confirmation_token) %>
3+
Follow this link to confirm your email address: <%= confirm_users_confirmation_url(@confirmation_token) %>

config/routes.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
resource :thank_you, only: [:show]
3232
resource :header_navigation, only: [:show]
3333
resource :registration, only: [:new, :create, :edit, :update, :destroy]
34-
resources :confirmations, only: [:new, :create, :edit, :update], param: :token
34+
resources :confirmations, only: [:new, :create, :edit, :update], param: :token do
35+
member do
36+
match "confirm" => "confirmations#update", :via => [:get]
37+
end
38+
end
3539
resources :passwords, only: [:new, :create, :edit, :update], param: :token
3640

3741
resources :newsletter_subscriptions, only: [:new, :create, :index, :show] do

spec/system/users/confirmations_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
visit email_link(mail, "Confirm your email address")
2323

24-
click_button "Confirm email"
25-
2624
expect(page).to have_content("Thank you for confirming your email address")
2725
expect(User.last).to be_confirmed
2826
end

spec/system/users/registrations_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171

7272
visit email_link(mail, "Confirm your email address")
7373

74-
click_button "Confirm email"
75-
7674
user = User.last
7775
expect(user).to be_confirmed
7876
expect(user.email).to eq("[email protected]")

0 commit comments

Comments
 (0)