Merged r9734 from trunk (#11032)

fix project list is not shown on Email notifications.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.0-stable@9739 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2012-05-28 10:31:19 +00:00
parent 0512a30368
commit 07edb10518
2 changed files with 24 additions and 1 deletions

View File

@@ -311,6 +311,29 @@ class UsersControllerTest < ActionController::TestCase
assert u.check_password?('newpass')
end
def test_update_notified_project
get :edit, :id => 2
assert_response :success
assert_template 'edit'
u = User.find(2)
assert_equal [1, 2, 5], u.projects.collect{|p| p.id}.sort
assert_equal [1, 2, 5], u.notified_projects_ids.sort
assert_tag :tag => 'input',
:attributes => {
:id => 'notified_project_ids_',
:value => 1,
}
assert_equal 'all', u.mail_notification
put :update, :id => 2,
:user => {
:mail_notification => 'selected',
},
:notified_project_ids => [1, 2]
u = User.find(2)
assert_equal 'selected', u.mail_notification
assert_equal [1, 2], u.notified_projects_ids.sort
end
def test_destroy
assert_difference 'User.count', -1 do
delete :destroy, :id => 2