X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/69b967c9ff7c185f99ba881a8b8591c02c809628..043d29fd7eb72048cf5d07edfbc20ec5c25af708:/test/integration/user_creation_test.rb diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb index db35be5f3..e0a51e4d3 100644 --- a/test/integration/user_creation_test.rb +++ b/test/integration/user_creation_test.rb @@ -92,7 +92,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the e-mail register_email = ActionMailer::Base.deliveries.first - assert_equal register_email.to[0], new_email + assert_equal register_email.to.first, new_email # Check that the confirm account url is correct assert_match /#{@url}/, register_email.body.to_s @@ -132,13 +132,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the e-mail register_email = ActionMailer::Base.deliveries.first - assert_equal register_email.to[0], new_email + assert_equal register_email.to.first, new_email # Check that the confirm account url is correct confirm_regex = Regexp.new("/user/redirect_tester/confirm\\?confirm_string=([a-zA-Z0-9]*)") - register_email.parts.each do |part| + email_text_parts(register_email).each do |part| assert_match confirm_regex, part.body.to_s end - confirm_string = register_email.parts[0].body.match(confirm_regex)[1] + confirm_string = email_text_parts(register_email).first.body.match(confirm_regex)[1] # Check the page assert_response :success @@ -245,13 +245,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the e-mail register_email = ActionMailer::Base.deliveries.first - assert_equal register_email.to[0], new_email + assert_equal register_email.to.first, new_email # Check that the confirm account url is correct confirm_regex = Regexp.new("/user/redirect_tester_openid/confirm\\?confirm_string=([a-zA-Z0-9]*)") - register_email.parts.each do |part| + email_text_parts(register_email).each do |part| assert_match confirm_regex, part.body.to_s end - confirm_string = register_email.parts[0].body.match(confirm_regex)[1] + confirm_string = email_text_parts(register_email).first.body.match(confirm_regex)[1] # Check the page assert_response :success @@ -362,13 +362,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the e-mail register_email = ActionMailer::Base.deliveries.first - assert_equal register_email.to[0], new_email + assert_equal register_email.to.first, new_email # Check that the confirm account url is correct confirm_regex = Regexp.new("/user/redirect_tester_google/confirm\\?confirm_string=([a-zA-Z0-9]*)") - register_email.parts.each do |part| + email_text_parts(register_email).each do |part| assert_match confirm_regex, part.body.to_s end - confirm_string = register_email.parts[0].body.match(confirm_regex)[1] + confirm_string = email_text_parts(register_email).first.body.match(confirm_regex)[1] # Check the page assert_response :success @@ -475,13 +475,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the e-mail register_email = ActionMailer::Base.deliveries.first - assert_equal register_email.to[0], new_email + assert_equal register_email.to.first, new_email # Check that the confirm account url is correct confirm_regex = Regexp.new("/user/redirect_tester_facebook/confirm\\?confirm_string=([a-zA-Z0-9]*)") - register_email.parts.each do |part| + email_text_parts(register_email).each do |part| assert_match confirm_regex, part.body.to_s end - confirm_string = register_email.parts[0].body.match(confirm_regex)[1] + confirm_string = email_text_parts(register_email).first.body.match(confirm_regex)[1] # Check the page assert_response :success @@ -588,13 +588,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the e-mail register_email = ActionMailer::Base.deliveries.first - assert_equal register_email.to[0], new_email + assert_equal register_email.to.first, new_email # Check that the confirm account url is correct confirm_regex = Regexp.new("/user/redirect_tester_windowslive/confirm\\?confirm_string=([a-zA-Z0-9]*)") - register_email.parts.each do |part| + email_text_parts(register_email).each do |part| assert_match confirm_regex, part.body.to_s end - confirm_string = register_email.parts[0].body.match(confirm_regex)[1] + confirm_string = email_text_parts(register_email).first.body.match(confirm_regex)[1] # Check the page assert_response :success @@ -701,13 +701,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the e-mail register_email = ActionMailer::Base.deliveries.first - assert_equal register_email.to[0], new_email + assert_equal register_email.to.first, new_email # Check that the confirm account url is correct confirm_regex = Regexp.new("/user/redirect_tester_github/confirm\\?confirm_string=([a-zA-Z0-9]*)") - register_email.parts.each do |part| + email_text_parts(register_email).each do |part| assert_match confirm_regex, part.body.to_s end - confirm_string = register_email.parts[0].body.match(confirm_regex)[1] + confirm_string = email_text_parts(register_email).first.body.match(confirm_regex)[1] # Check the page assert_response :success @@ -814,13 +814,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the e-mail register_email = ActionMailer::Base.deliveries.first - assert_equal register_email.to[0], new_email + assert_equal register_email.to.first, new_email # Check that the confirm account url is correct confirm_regex = Regexp.new("/user/redirect_tester_wikipedia/confirm\\?confirm_string=([a-zA-Z0-9]*)") - register_email.parts.each do |part| + email_text_parts(register_email).each do |part| assert_match confirm_regex, part.body.to_s end - confirm_string = register_email.parts[0].body.match(confirm_regex)[1] + confirm_string = email_text_parts(register_email).first.body.match(confirm_regex)[1] # Check the page assert_response :success