mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 03:15:57 +01:00
Ability to add non-member watchers on issue creation (#5159).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9254 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1680,6 +1680,21 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
:value => 'Value for field 2'}
|
||||
end
|
||||
|
||||
def test_post_create_with_failure_should_preserve_watchers
|
||||
assert !User.find(8).member_of?(Project.find(1))
|
||||
|
||||
@request.session[:user_id] = 2
|
||||
post :create, :project_id => 1,
|
||||
:issue => {:tracker_id => 1,
|
||||
:watcher_user_ids => ['3', '8']}
|
||||
assert_response :success
|
||||
assert_template 'new'
|
||||
|
||||
assert_tag 'input', :attributes => {:name => 'issue[watcher_user_ids][]', :value => '2', :checked => nil}
|
||||
assert_tag 'input', :attributes => {:name => 'issue[watcher_user_ids][]', :value => '3', :checked => 'checked'}
|
||||
assert_tag 'input', :attributes => {:name => 'issue[watcher_user_ids][]', :value => '8', :checked => 'checked'}
|
||||
end
|
||||
|
||||
def test_post_create_should_ignore_non_safe_attributes
|
||||
@request.session[:user_id] = 2
|
||||
assert_nothing_raised do
|
||||
|
||||
Reference in New Issue
Block a user