diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-08-06 15:47:27 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-08-06 15:47:27 +0000 |
commit | 041bca6ac90d0d53c6e29a729e84b66b4d87b040 (patch) | |
tree | 72b7fd97136fe78a610057280a8574d068350e2d /test | |
parent | e4af6e77a7347f02491ca95f0a5eb32e40e271ef (diff) | |
download | redmine-041bca6ac90d0d53c6e29a729e84b66b4d87b040.tar.gz redmine-041bca6ac90d0d53c6e29a729e84b66b4d87b040.zip |
Refactor: start to split IssuesController#move into two separate actions.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3918 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/issues_controller_test.rb | 26 | ||||
-rw-r--r-- | test/integration/routing_test.rb | 2 |
2 files changed, 14 insertions, 14 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 670fb2d7e..92e6fd30a 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -1038,22 +1038,22 @@ class IssuesControllerTest < ActionController::TestCase assert_redirected_to :controller => 'issues', :action => 'index', :project_id => Project.find(1).identifier end - def test_move_one_issue_to_another_project + def test_perform_move_one_issue_to_another_project @request.session[:user_id] = 2 - post :move, :id => 1, :new_project_id => 2, :tracker_id => '', :assigned_to_id => '', :status_id => '', :start_date => '', :due_date => '' + post :perform_move, :id => 1, :new_project_id => 2, :tracker_id => '', :assigned_to_id => '', :status_id => '', :start_date => '', :due_date => '' assert_redirected_to :action => 'index', :project_id => 'ecookbook' assert_equal 2, Issue.find(1).project_id end - def test_move_one_issue_to_another_project_should_follow_when_needed + def test_perform_move_one_issue_to_another_project_should_follow_when_needed @request.session[:user_id] = 2 - post :move, :id => 1, :new_project_id => 2, :follow => '1' + post :perform_move, :id => 1, :new_project_id => 2, :follow => '1' assert_redirected_to '/issues/1' end - def test_bulk_move_to_another_project + def test_bulk_perform_move_to_another_project @request.session[:user_id] = 2 - post :move, :ids => [1, 2], :new_project_id => 2 + post :perform_move, :ids => [1, 2], :new_project_id => 2 assert_redirected_to :action => 'index', :project_id => 'ecookbook' # Issues moved to project 2 assert_equal 2, Issue.find(1).project_id @@ -1063,9 +1063,9 @@ class IssuesControllerTest < ActionController::TestCase assert_equal 2, Issue.find(2).tracker_id end - def test_bulk_move_to_another_tracker + def test_bulk_perform_move_to_another_tracker @request.session[:user_id] = 2 - post :move, :ids => [1, 2], :new_tracker_id => 2 + post :perform_move, :ids => [1, 2], :new_tracker_id => 2 assert_redirected_to :action => 'index', :project_id => 'ecookbook' assert_equal 2, Issue.find(1).tracker_id assert_equal 2, Issue.find(2).tracker_id @@ -1075,19 +1075,19 @@ class IssuesControllerTest < ActionController::TestCase @request.session[:user_id] = 2 assert_difference 'Issue.count', 2 do assert_no_difference 'Project.find(1).issues.count' do - post :move, :ids => [1, 2], :new_project_id => 2, :copy_options => {:copy => '1'} + post :perform_move, :ids => [1, 2], :new_project_id => 2, :copy_options => {:copy => '1'} end end assert_redirected_to 'projects/ecookbook/issues' end - context "#move via bulk copy" do + context "#perform_move via bulk copy" do should "allow not changing the issue's attributes" do @request.session[:user_id] = 2 issue_before_move = Issue.find(1) assert_difference 'Issue.count', 1 do assert_no_difference 'Project.find(1).issues.count' do - post :move, :ids => [1], :new_project_id => 2, :copy_options => {:copy => '1'}, :new_tracker_id => '', :assigned_to_id => '', :status_id => '', :start_date => '', :due_date => '' + post :perform_move, :ids => [1], :new_project_id => 2, :copy_options => {:copy => '1'}, :new_tracker_id => '', :assigned_to_id => '', :status_id => '', :start_date => '', :due_date => '' end end issue_after_move = Issue.first(:order => 'id desc', :conditions => {:project_id => 2}) @@ -1104,7 +1104,7 @@ class IssuesControllerTest < ActionController::TestCase @request.session[:user_id] = 2 assert_difference 'Issue.count', 2 do assert_no_difference 'Project.find(1).issues.count' do - post :move, :ids => [1, 2], :new_project_id => 2, :copy_options => {:copy => '1'}, :new_tracker_id => '', :assigned_to_id => 4, :status_id => 3, :start_date => '2009-12-01', :due_date => '2009-12-31' + post :perform_move, :ids => [1, 2], :new_project_id => 2, :copy_options => {:copy => '1'}, :new_tracker_id => '', :assigned_to_id => 4, :status_id => 3, :start_date => '2009-12-01', :due_date => '2009-12-31' end end @@ -1122,7 +1122,7 @@ class IssuesControllerTest < ActionController::TestCase def test_copy_to_another_project_should_follow_when_needed @request.session[:user_id] = 2 - post :move, :ids => [1], :new_project_id => 2, :copy_options => {:copy => '1'}, :follow => '1' + post :perform_move, :ids => [1], :new_project_id => 2, :copy_options => {:copy => '1'}, :follow => '1' issue = Issue.first(:order => 'id DESC') assert_redirected_to :controller => 'issues', :action => 'show', :id => issue end diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index f8476df56..51f8e71f6 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -86,7 +86,7 @@ class RoutingTest < ActionController::IntegrationTest should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64' should_route :get, "/issues/1/move", :controller => 'issues', :action => 'move', :id => '1' - should_route :post, "/issues/1/move", :controller => 'issues', :action => 'move', :id => '1' + should_route :post, "/issues/1/perform_move", :controller => 'issues', :action => 'perform_move', :id => '1' should_route :post, "/issues/1/quoted", :controller => 'issues', :action => 'reply', :id => '1' |