From a32822477170bf57a482365b8c6c47bd617147e3 Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang <jp_lang@yahoo.fr>
Date: Fri, 13 Feb 2015 20:00:22 +0000
Subject: Removed IssuesController#update_form action, use #new and #edit
 instead.

git-svn-id: http://svn.redmine.org/redmine/trunk@13997 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
 test/functional/issues_controller_test.rb | 23 ++++++++++-------------
 test/integration/routing/issues_test.rb   |  4 ++--
 2 files changed, 12 insertions(+), 15 deletions(-)

(limited to 'test')

diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 7a58d5e92..5e8762e08 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -1757,13 +1757,13 @@ class IssuesControllerTest < ActionController::TestCase
 
   def test_update_form_for_new_issue
     @request.session[:user_id] = 2
-    xhr :post, :update_form, :project_id => 1,
+    xhr :post, :new, :project_id => 1,
                      :issue => {:tracker_id => 2,
                                 :subject => 'This is the test_new issue',
                                 :description => 'This is the description',
                                 :priority_id => 5}
     assert_response :success
-    assert_template 'update_form'
+    assert_template 'new'
     assert_template :partial => '_form'
     assert_equal 'text/javascript', response.content_type
 
@@ -1781,7 +1781,7 @@ class IssuesControllerTest < ActionController::TestCase
     WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 5)
     WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 5, :new_status_id => 4)
 
-    xhr :post, :update_form, :project_id => 1,
+    xhr :post, :new, :project_id => 1,
                      :issue => {:tracker_id => 1,
                                 :status_id => 5,
                                 :subject => 'This is an issue'}
@@ -1796,7 +1796,7 @@ class IssuesControllerTest < ActionController::TestCase
     tracker.update! :default_status_id => 2
     tracker.generate_transitions! 2, 1, :clear => true
 
-    xhr :post, :update_form, :project_id => 1,
+    xhr :post, :new, :project_id => 1,
                      :issue => {:tracker_id => 2,
                                 :status_id => 1},
                      :was_default_status => 1
@@ -2776,15 +2776,14 @@ class IssuesControllerTest < ActionController::TestCase
 
   def test_update_form_for_existing_issue
     @request.session[:user_id] = 2
-    xhr :put, :update_form, :project_id => 1,
-                             :id => 1,
+    xhr :patch, :edit, :id => 1,
                              :issue => {:tracker_id => 2,
                                         :subject => 'This is the test_new issue',
                                         :description => 'This is the description',
                                         :priority_id => 5}
     assert_response :success
     assert_equal 'text/javascript', response.content_type
-    assert_template 'update_form'
+    assert_template 'edit'
     assert_template :partial => '_form'
 
     issue = assigns(:issue)
@@ -2797,7 +2796,7 @@ class IssuesControllerTest < ActionController::TestCase
 
   def test_update_form_for_existing_issue_should_keep_issue_author
     @request.session[:user_id] = 3
-    xhr :put, :update_form, :project_id => 1, :id => 1, :issue => {:subject => 'Changed'}
+    xhr :patch, :edit, :id => 1, :issue => {:subject => 'Changed'}
     assert_response :success
     assert_equal 'text/javascript', response.content_type
 
@@ -2814,8 +2813,7 @@ class IssuesControllerTest < ActionController::TestCase
     WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 2, :new_status_id => 5)
     WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 5, :new_status_id => 4)
 
-    xhr :put, :update_form, :project_id => 1,
-                    :id => 2,
+    xhr :patch, :edit, :id => 2,
                     :issue => {:tracker_id => 2,
                                :status_id => 5,
                                :subject => 'This is an issue'}
@@ -2826,8 +2824,7 @@ class IssuesControllerTest < ActionController::TestCase
 
   def test_update_form_for_existing_issue_with_project_change
     @request.session[:user_id] = 2
-    xhr :put, :update_form, :project_id => 1,
-                             :id => 1,
+    xhr :patch, :edit, :id => 1,
                              :issue => {:project_id => 2,
                                         :tracker_id => 2,
                                         :subject => 'This is the test_new issue',
@@ -2849,7 +2846,7 @@ class IssuesControllerTest < ActionController::TestCase
     WorkflowTransition.delete_all
     WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 2, :new_status_id => 3)
 
-    xhr :put, :update_form, :project_id => 1, :id => 2
+    xhr :patch, :edit, :id => 2
     assert_response :success
     assert_equal [2,3], assigns(:allowed_statuses).map(&:id).sort
   end
diff --git a/test/integration/routing/issues_test.rb b/test/integration/routing/issues_test.rb
index ded631795..1b59f3214 100644
--- a/test/integration/routing/issues_test.rb
+++ b/test/integration/routing/issues_test.rb
@@ -50,7 +50,7 @@ class RoutingIssuesTest < Redmine::RoutingTest
   end
 
   def test_issues_form_update
-    should_route 'POST /projects/23/issues/update_form' => 'issues#update_form', :project_id => '23'
-    should_route 'PUT /projects/23/issues/update_form' => 'issues#update_form', :project_id => '23'
+    should_route 'POST /projects/23/issues/new' => 'issues#new', :project_id => '23'
+    should_route 'PATCH /issues/23/edit' => 'issues#edit', :id => '23'
   end
 end
-- 
cgit v1.2.3