From 9fce36a0d437499e5709684aed741590bad85f07 Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Tue, 6 Nov 2012 19:13:20 +0100 Subject: [PATCH] when executing the regex for login and password in a mail, dont get confused by windows-newlines --- test/unit/mail_handler_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 84e8b1b1db..a4d42c6efd 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -211,8 +211,8 @@ class MailHandlerTest < ActiveSupport::TestCase email = ActionMailer::Base.deliveries.first assert_not_nil email assert email.subject.include?('account activation') - login = email.body.encoded.match(/\* Login: (.*)$/)[1] - password = email.body.encoded.match(/\* Password: (.*)$/)[1] + login = email.body.encoded.match(/\* Login: (\S+)\s?$/)[1] + password = email.body.encoded.match(/\* Password: (\S+)\s?$/)[1] assert_equal issue.author, User.try_to_login(login, password) end end