]> source.dussan.org Git - redmine.git/commitdiff
Test that account activation email contains the appropriate link (#2825).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Mar 2009 12:45:46 +0000 (12:45 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Mar 2009 12:45:46 +0000 (12:45 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2561 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/mailer_test.rb

index 1569389638ccd19b97c199d167bb0a524f320190..e3eb65ae4ab36f9cdfa09b70cc48ce5b90f81302 100644 (file)
@@ -207,10 +207,16 @@ class MailerTest < Test::Unit::TestCase
 
   def test_register
     token = Token.find(1)
+    Setting.host_name = 'redmine.foo'
+    Setting.protocol = 'https'
+    
     valid_languages.each do |lang|
       token.user.update_attribute :language, lang.to_s
       token.reload
+      ActionMailer::Base.deliveries.clear
       assert Mailer.deliver_register(token)
+      mail = ActionMailer::Base.deliveries.last
+      assert mail.body.include?("https://redmine.foo/account/activate?token=#{token.value}")
     end
   end