Patch #3654 ยป issue_move_redirect.diff
| test/functional/issues_controller_test.rb (working copy) | ||
|---|---|---|
|
def test_move_one_issue_to_another_project
|
||
|
@request.session[:user_id] = 2
|
||
|
post :move, :id => 1, :new_project_id => 2
|
||
|
assert_redirected_to :action => 'index', :project_id => 'ecookbook'
|
||
|
assert_redirected_to :action => 'show', :id => 1
|
||
|
assert_equal 2, Issue.find(1).project_id
|
||
|
end
|
||
| app/controllers/issues_controller.rb (working copy) | ||
|---|---|---|
|
:total => @issues.size,
|
||
|
:ids => '#' + unsaved_issue_ids.join(', #'))
|
||
|
end
|
||
|
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
|
||
|
# don't look at @issues.size > 1, that still could have come from a
|
||
|
# context menu (i. e. the issue list)
|
||
|
if params[:ids]
|
||
|
redirect_to :controller => 'issues', :action => 'index', :project_id => @project
|
||
|
else
|
||
|
redirect_to :controller => 'issues', :action => 'show', :id => @issues.first
|
||
|
end
|
||
|
return
|
||
|
end
|
||
|
render :layout => false if request.xhr?
|
||
|
end
|
||
|
|
||
|
|
||
|
def destroy
|
||
|
@hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f
|
||
|
if @hours > 0
|
||