Commit d2d7d6651668c287c0305d546481d445abbb9201
1 parent
e1091633
Exists in
master
and in
29 other branches
rails3: fix change_password tests
Showing
2 changed files
with
3 additions
and
2 deletions
Show diff stats
app/models/change_password.rb
... | ... | @@ -86,7 +86,7 @@ class ChangePassword < Task |
86 | 86 | code = self.code |
87 | 87 | url = url_for(:host => hostname, :controller => 'account', :action => 'new_password', :code => code) |
88 | 88 | |
89 | - lambda do | |
89 | + proc do | |
90 | 90 | _("In order to change your password, please visit the following address:\n\n%s") % url |
91 | 91 | end |
92 | 92 | end | ... | ... |
test/unit/change_password_test.rb
... | ... | @@ -144,8 +144,9 @@ class ChangePasswordTest < ActiveSupport::TestCase |
144 | 144 | person = fast_create(Person, :identifier => 'testuser') |
145 | 145 | |
146 | 146 | task = ChangePassword.create(:login => 'testuser', :email => 'test@example.com', :environment_id => Environment.default.id) |
147 | + task.requestor.stubs(:notification_emails).returns(['random@example.org']) | |
147 | 148 | |
148 | - email = TaskMailer.deliver_task_created(task) | |
149 | + email = task.send(:send_notification, :created).deliver | |
149 | 150 | assert_match(/#{task.requestor.name} wants to change its password/, email.subject) |
150 | 151 | end |
151 | 152 | ... | ... |