summaryrefslogtreecommitdiffstats
path: root/test/functional/users_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-12 13:39:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-12 13:39:55 +0000
commitcde02954c84591c66c575f0d76d44c18ab6edf95 (patch)
treeedd7847b9c329720c914575c884a1c1904fc6fd7 /test/functional/users_controller_test.rb
parenta4d7a99c22d9aac89a38c1cb411158777b72bb9d (diff)
downloadredmine-cde02954c84591c66c575f0d76d44c18ab6edf95.tar.gz
redmine-cde02954c84591c66c575f0d76d44c18ab6edf95.zip
Moves password param to user hash param so that it can be set using the User API.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4493 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/users_controller_test.rb')
-rw-r--r--test/functional/users_controller_test.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 100ec8ded..8b879cc30 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -152,6 +152,11 @@ class UsersControllerTest < ActionController::TestCase
user = User.last
assert_equal 'none', user.mail_notification
end
+
+ should 'set the password' do
+ user = User.first(:order => 'id DESC')
+ assert user.check_password?('test')
+ end
end
context "when unsuccessful" do
@@ -194,13 +199,13 @@ class UsersControllerTest < ActionController::TestCase
assert mail.body.include?(ll('fr', :notice_account_activated))
end
- def test_updat_with_password_change_should_send_a_notification
+ def test_update_with_password_change_should_send_a_notification
ActionMailer::Base.deliveries.clear
Setting.bcc_recipients = '1'
+ put :update, :id => 2, :user => {:password => 'newpass', :password_confirmation => 'newpass'}, :send_information => '1'
u = User.find(2)
- put :update, :id => u.id, :user => {}, :password => 'newpass', :password_confirmation => 'newpass', :send_information => '1'
- assert_equal User.hash_password('newpass'), u.reload.hashed_password
+ assert u.check_password?('newpass')
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
@@ -214,10 +219,10 @@ class UsersControllerTest < ActionController::TestCase
u.auth_source = AuthSource.find(1)
u.save!
- put :update, :id => u.id, :user => {:auth_source_id => ''}, :password => 'newpass', :password_confirmation => 'newpass'
+ put :update, :id => u.id, :user => {:auth_source_id => '', :password => 'newpass'}, :password_confirmation => 'newpass'
assert_equal nil, u.reload.auth_source
- assert_equal User.hash_password('newpass'), u.reload.hashed_password
+ assert u.check_password?('newpass')
end
def test_edit_membership