Moves mail_notification 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@4496 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-12-12 14:19:24 +00:00
parent 1d4f28a54d
commit 9e2d401f43
5 changed files with 15 additions and 23 deletions

View File

@@ -139,9 +139,9 @@ class UsersControllerTest < ActionController::TestCase
:login => 'jdoe',
:password => 'test',
:password_confirmation => 'test',
:mail => 'jdoe@gmail.com'
},
:notification_option => 'none'
:mail => 'jdoe@gmail.com',
:mail_notification => 'none'
}
end
should_assign_to :user
@@ -173,11 +173,11 @@ class UsersControllerTest < ActionController::TestCase
def test_update
ActionMailer::Base.deliveries.clear
put :update, :id => 2, :user => {:firstname => 'Changed'}, :notification_option => 'all', :pref => {:hide_mail => '1', :comments_sorting => 'desc'}
put :update, :id => 2, :user => {:firstname => 'Changed', :mail_notification => 'only_assigned'}, :pref => {:hide_mail => '1', :comments_sorting => 'desc'}
user = User.find(2)
assert_equal 'Changed', user.firstname
assert_equal 'all', user.mail_notification
assert_equal 'only_assigned', user.mail_notification
assert_equal true, user.pref[:hide_mail]
assert_equal 'desc', user.pref[:comments_sorting]
assert ActionMailer::Base.deliveries.empty?