diff test/functional/.svn/text-base/users_controller_test.rb.svn-base @ 22:40f7cfd4df19

* Update to SVN trunk rev 4173
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 24 Sep 2010 14:06:04 +0100
parents 1d32c0a0efbf
children 94944d00e43c
line wrap: on
line diff
--- a/test/functional/.svn/text-base/users_controller_test.rb.svn-base	Wed Aug 25 16:30:24 2010 +0100
+++ b/test/functional/.svn/text-base/users_controller_test.rb.svn-base	Fri Sep 24 14:06:04 2010 +0100
@@ -143,6 +143,18 @@
     assert_equal [u.mail], mail.bcc
     assert mail.body.include?('newpass')
   end
+
+  test "POST :edit with a password change to an AuthSource user switching to Internal authentication" do
+    # Configure as auth source
+    u = User.find(2)
+    u.auth_source = AuthSource.find(1)
+    u.save!
+
+    post :edit, :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
+  end
   
   def test_edit_membership
     post :edit_membership, :id => 2, :membership_id => 1,