summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-02-22 18:15:07 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-02-22 18:15:07 +0000
commit89cf2d256dd4a2072b223f7d8117cb4997ae86d8 (patch)
tree7d5d9a25f014888527fd8942289d7679c81020cf /test/integration
parent0341ac80eb36d0ca872b2b85ef5cb75b783d14cb (diff)
downloadredmine-89cf2d256dd4a2072b223f7d8117cb4997ae86d8.tar.gz
redmine-89cf2d256dd4a2072b223f7d8117cb4997ae86d8.zip
Moved the IssuesController routing tests to an integration test.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3474 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/routing_test.rb44
1 files changed, 43 insertions, 1 deletions
diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb
index 5f9b8c192..0e347d77d 100644
--- a/test/integration/routing_test.rb
+++ b/test/integration/routing_test.rb
@@ -18,9 +18,51 @@
require "test_helper"
class RoutingTest < ActionController::IntegrationTest
+ context "issues" do
+ # REST actions
+ should_route :get, "/issues", :controller => 'issues', :action => 'index'
+ should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf'
+ should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom'
+ should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml'
+ should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23'
+ should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf'
+ should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom'
+ should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml'
+ should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64'
+ should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf'
+ should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom'
+ should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml'
+
+ should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
+
+ should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
+ # TODO: Should use PUT
+ should_route :post, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
+
+ # TODO: Should use DELETE
+ should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64'
+
+ # Extra actions
+ 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/quoted", :controller => 'issues', :action => 'reply', :id => '1'
+
+ should_route :get, "/issues/calendar", :controller => 'issues', :action => 'calendar'
+ should_route :post, "/issues/calendar", :controller => 'issues', :action => 'calendar'
+ should_route :get, "/projects/project-name/issues/calendar", :controller => 'issues', :action => 'calendar', :project_id => 'project-name'
+ should_route :post, "/projects/project-name/issues/calendar", :controller => 'issues', :action => 'calendar', :project_id => 'project-name'
+
+ should_route :get, "/issues/gantt", :controller => 'issues', :action => 'gantt'
+ should_route :post, "/issues/gantt", :controller => 'issues', :action => 'gantt'
+ should_route :get, "/projects/project-name/issues/gantt", :controller => 'issues', :action => 'gantt', :project_id => 'project-name'
+ should_route :post, "/projects/project-name/issues/gantt", :controller => 'issues', :action => 'gantt', :project_id => 'project-name'
+ end
+
context "issue reports" do
should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567'
should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to'
end
-
end