From 1b5200b7978ba2be1c53403b1b9d01457f766130 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 25 Feb 2024 10:04:18 +0000 Subject: [PATCH] Treat github and wikipedia provided emails as confirmed Fixes #4270 --- app/controllers/users_controller.rb | 2 +- test/integration/user_creation_test.rb | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ab13f93be..b017c33b9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -247,7 +247,7 @@ class UsersController < ApplicationController when "openid" uid.match(%r{https://www.google.com/accounts/o8/id?(.*)}) || uid.match(%r{https://me.yahoo.com/(.*)}) - when "google", "facebook", "microsoft" + when "google", "facebook", "microsoft", "github", "wikipedia" true else false diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb index 253f298a5..77b23c039 100644 --- a/test/integration/user_creation_test.rb +++ b/test/integration/user_creation_test.rb @@ -852,7 +852,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest OmniAuth.config.add_mock(:github, :uid => "123454321", :info => { "email" => new_email }) assert_difference("User.count") do - assert_difference("ActionMailer::Base.deliveries.size", 1) do + assert_no_difference("ActionMailer::Base.deliveries.size") do perform_enqueued_jobs do post "/user/new", :params => { :user => { :email => new_email, @@ -880,7 +880,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest :read_ct => 1, :read_tou => 1 } assert_response :redirect - assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name + assert_redirected_to welcome_path follow_redirect! end end @@ -888,7 +888,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the page assert_response :success - assert_template "confirmations/confirm" + assert_template "site/welcome" ActionMailer::Base.deliveries.clear end @@ -1006,7 +1006,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest OmniAuth.config.add_mock(:wikipedia, :uid => "123454321", :info => { "email" => new_email }) assert_difference("User.count") do - assert_difference("ActionMailer::Base.deliveries.size", 1) do + assert_no_difference("ActionMailer::Base.deliveries.size") do perform_enqueued_jobs do post "/user/new", :params => { :user => { :email => new_email, @@ -1034,7 +1034,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest :read_ct => 1, :read_tou => 1 } assert_response :redirect - assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name + assert_redirected_to welcome_path follow_redirect! end end @@ -1042,7 +1042,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the page assert_response :success - assert_template "confirmations/confirm" + assert_template "site/welcome" ActionMailer::Base.deliveries.clear end -- 2.39.5