Project

General

Profile

Patch #3654 ยป issue_move_redirect.diff

Wolfgang Schnerring, 2009-07-22 17:28

View differences:

test/functional/issues_controller_test.rb (working copy)
934 934
  def test_move_one_issue_to_another_project
935 935
    @request.session[:user_id] = 2
936 936
    post :move, :id => 1, :new_project_id => 2
937
    assert_redirected_to :action => 'index', :project_id => 'ecookbook'
937
    assert_redirected_to :action => 'show', :id => 1
938 938
    assert_equal 2, Issue.find(1).project_id
939 939
  end
940 940

  
app/controllers/issues_controller.rb (working copy)
303 303
                                                         :total => @issues.size,
304 304
                                                         :ids => '#' + unsaved_issue_ids.join(', #'))
305 305
      end
306
      redirect_to :controller => 'issues', :action => 'index', :project_id => @project
306
      # don't look at @issues.size > 1, that still could have come from a
307
      # context menu (i. e. the issue list)
308
      if params[:ids]
309
        redirect_to :controller => 'issues', :action => 'index', :project_id => @project
310
      else
311
        redirect_to :controller => 'issues', :action => 'show', :id => @issues.first
312
      end
307 313
      return
308 314
    end
309 315
    render :layout => false if request.xhr?
310 316
  end
311
  
317
   
312 318
  def destroy
313 319
    @hours = TimeEntry.sum(:hours, :conditions => ['issue_id IN (?)', @issues]).to_f
314 320
    if @hours > 0
    (1-1/1)