summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-15 07:06:11 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-15 07:06:11 +0000
commitf968acbfacc8f67cd104b158e7ec5ed71d464659 (patch)
tree7fd7ed461332da6dc0bb505fbaa2b9fec9667879
parent4d2a832fb663b91722543b0b1b0af7f39ef44124 (diff)
downloadredmine-f968acbfacc8f67cd104b158e7ec5ed71d464659.tar.gz
redmine-f968acbfacc8f67cd104b158e7ec5ed71d464659.zip
test: replace "should_route" of "documents" to "assert_routing" at integration/routing_test.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8220 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/integration/routing_test.rb44
1 files changed, 33 insertions, 11 deletions
diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb
index 1f0d09aab..aa5f423f8 100644
--- a/test/integration/routing_test.rb
+++ b/test/integration/routing_test.rb
@@ -123,17 +123,39 @@ class RoutingTest < ActionController::IntegrationTest
)
end
- context "documents" do
- should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567'
- should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
- should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22'
- should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22'
-
- should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567'
- should_route :put, "/documents/22", :controller => 'documents', :action => 'update', :id => '22'
- should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22'
-
- should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22'
+ def test_documents
+ assert_routing(
+ { :method => 'get', :path => "/projects/567/documents" },
+ { :controller => 'documents', :action => 'index', :project_id => '567' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/projects/567/documents/new" },
+ { :controller => 'documents', :action => 'new', :project_id => '567' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/documents/22" },
+ { :controller => 'documents', :action => 'show', :id => '22' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/documents/22/edit" },
+ { :controller => 'documents', :action => 'edit', :id => '22' }
+ )
+ assert_routing(
+ { :method => 'post', :path => "/projects/567/documents" },
+ { :controller => 'documents', :action => 'create', :project_id => '567' }
+ )
+ assert_routing(
+ { :method => 'put', :path => "/documents/22" },
+ { :controller => 'documents', :action => 'update', :id => '22' }
+ )
+ assert_routing(
+ { :method => 'delete', :path => "/documents/22" },
+ { :controller => 'documents', :action => 'destroy', :id => '22' }
+ )
+ assert_routing(
+ { :method => 'post', :path => "/documents/22/add_attachment" },
+ { :controller => 'documents', :action => 'add_attachment', :id => '22' }
+ )
end
context "roles" do