Defect #26880 » fix_26880.patch
| app/controllers/issues_controller.rb | ||
|---|---|---|
|
attrs.delete(:fixed_version_id)
|
||
|
end
|
||
|
@issue.safe_attributes = attrs
|
||
|
@issue.watcher_user_ids = [] if params[:issue] && params[:issue][:watcher_user_ids].blank?
|
||
|
if @issue.project
|
||
|
@issue.tracker ||= @issue.allowed_target_trackers.first
|
||
| test/functional/issues_controller_test.rb | ||
|---|---|---|
|
assert_equal 1, issue.project_id
|
||
|
end
|
||
|
def test_create_as_copy_with_watcher_user_ids_should_copy_watchers
|
||
|
@request.session[:user_id] = 2
|
||
|
copied = Issue.generate!
|
||
|
copied.add_watcher User.find(2)
|
||
|
copied.add_watcher User.find(3)
|
||
|
assert_difference 'Issue.count' do
|
||
|
post :create, :params => {
|
||
|
:project_id => 1,
|
||
|
:copy_from => copied.id,
|
||
|
:issue => {
|
||
|
:subject => 'Copy cleared watchers',
|
||
|
:watcher_user_ids => [3]
|
||
|
}
|
||
|
}
|
||
|
end
|
||
|
issue = Issue.order('id DESC').first
|
||
|
assert_equal [3], issue.watcher_user_ids
|
||
|
end
|
||
|
def test_create_as_copy_without_watcher_user_ids_should_not_copy_watchers
|
||
|
@request.session[:user_id] = 2
|
||
|
copied = Issue.generate!
|
||
|
copied.add_watcher User.find(2)
|
||
|
copied.add_watcher User.find(3)
|
||
|
assert_difference 'Issue.count' do
|
||
|
post :create, :params => {
|
||
|
:project_id => 1,
|
||
|
:copy_from => copied.id,
|
||
|
:issue => {
|
||
|
:subject => 'Copy cleared watchers'
|
||
|
}
|
||
|
}
|
||
|
end
|
||
|
issue = Issue.order('id DESC').first
|
||
|
assert_equal [], issue.watcher_user_ids
|
||
|
end
|
||
|
def test_get_edit
|
||
|
@request.session[:user_id] = 2
|
||
|
get :edit, :params => {
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »