##// END OF EJS Templates
test: route: split documents test whether scoped under project or not...
Toshi MARUYAMA -
r8429:b6c920a976a1
parent child
Show More
@@ -18,7 +18,7
18 require File.expand_path('../../../test_helper', __FILE__)
18 require File.expand_path('../../../test_helper', __FILE__)
19
19
20 class RoutingDocumentsTest < ActionController::IntegrationTest
20 class RoutingDocumentsTest < ActionController::IntegrationTest
21 def test_documents
21 def test_documents_scoped_under_project
22 assert_routing(
22 assert_routing(
23 { :method => 'get', :path => "/projects/567/documents" },
23 { :method => 'get', :path => "/projects/567/documents" },
24 { :controller => 'documents', :action => 'index', :project_id => '567' }
24 { :controller => 'documents', :action => 'index', :project_id => '567' }
@@ -28,6 +28,13 class RoutingDocumentsTest < ActionController::IntegrationTest
28 { :controller => 'documents', :action => 'new', :project_id => '567' }
28 { :controller => 'documents', :action => 'new', :project_id => '567' }
29 )
29 )
30 assert_routing(
30 assert_routing(
31 { :method => 'post', :path => "/projects/567/documents" },
32 { :controller => 'documents', :action => 'create', :project_id => '567' }
33 )
34 end
35
36 def test_documents
37 assert_routing(
31 { :method => 'get', :path => "/documents/22" },
38 { :method => 'get', :path => "/documents/22" },
32 { :controller => 'documents', :action => 'show', :id => '22' }
39 { :controller => 'documents', :action => 'show', :id => '22' }
33 )
40 )
@@ -36,10 +43,6 class RoutingDocumentsTest < ActionController::IntegrationTest
36 { :controller => 'documents', :action => 'edit', :id => '22' }
43 { :controller => 'documents', :action => 'edit', :id => '22' }
37 )
44 )
38 assert_routing(
45 assert_routing(
39 { :method => 'post', :path => "/projects/567/documents" },
40 { :controller => 'documents', :action => 'create', :project_id => '567' }
41 )
42 assert_routing(
43 { :method => 'put', :path => "/documents/22" },
46 { :method => 'put', :path => "/documents/22" },
44 { :controller => 'documents', :action => 'update', :id => '22' }
47 { :controller => 'documents', :action => 'update', :id => '22' }
45 )
48 )
General Comments 0
You need to be logged in to leave comments. Login now