mirror of
https://github.com/redmine/redmine.git
synced 2026-05-09 16:46:27 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user