##// END OF EJS Templates
test: route: split issues rest actions tests whether scoped under project or not...
Toshi MARUYAMA -
r8313:9835f4b800a4
parent child
Show More
@@ -36,41 +36,44 class RoutingIssuesTest < ActionController::IntegrationTest
36 { :controller => 'issues', :action => 'index', :format => 'xml' }
36 { :controller => 'issues', :action => 'index', :format => 'xml' }
37 )
37 )
38 assert_routing(
38 assert_routing(
39 { :method => 'get', :path => "/projects/23/issues" },
39 { :method => 'get', :path => "/issues/64" },
40 { :controller => 'issues', :action => 'index', :project_id => '23' }
40 { :controller => 'issues', :action => 'show', :id => '64' }
41 )
41 )
42 assert_routing(
42 assert_routing(
43 { :method => 'get', :path => "/projects/23/issues.pdf" },
43 { :method => 'get', :path => "/issues/64.pdf" },
44 { :controller => 'issues', :action => 'index', :project_id => '23',
44 { :controller => 'issues', :action => 'show', :id => '64',
45 :format => 'pdf' }
45 :format => 'pdf' }
46 )
46 )
47 assert_routing(
47 assert_routing(
48 { :method => 'get', :path => "/projects/23/issues.atom" },
48 { :method => 'get', :path => "/issues/64.atom" },
49 { :controller => 'issues', :action => 'index', :project_id => '23',
49 { :controller => 'issues', :action => 'show', :id => '64',
50 :format => 'atom' }
50 :format => 'atom' }
51 )
51 )
52 assert_routing(
52 assert_routing(
53 { :method => 'get', :path => "/projects/23/issues.xml" },
53 { :method => 'get', :path => "/issues/64.xml" },
54 { :controller => 'issues', :action => 'index', :project_id => '23',
54 { :controller => 'issues', :action => 'show', :id => '64',
55 :format => 'xml' }
55 :format => 'xml' }
56 )
56 )
57 end
58
59 def test_issues_rest_actions_scoped_under_project
57 assert_routing(
60 assert_routing(
58 { :method => 'get', :path => "/issues/64" },
61 { :method => 'get', :path => "/projects/23/issues" },
59 { :controller => 'issues', :action => 'show', :id => '64' }
62 { :controller => 'issues', :action => 'index', :project_id => '23' }
60 )
63 )
61 assert_routing(
64 assert_routing(
62 { :method => 'get', :path => "/issues/64.pdf" },
65 { :method => 'get', :path => "/projects/23/issues.pdf" },
63 { :controller => 'issues', :action => 'show', :id => '64',
66 { :controller => 'issues', :action => 'index', :project_id => '23',
64 :format => 'pdf' }
67 :format => 'pdf' }
65 )
68 )
66 assert_routing(
69 assert_routing(
67 { :method => 'get', :path => "/issues/64.atom" },
70 { :method => 'get', :path => "/projects/23/issues.atom" },
68 { :controller => 'issues', :action => 'show', :id => '64',
71 { :controller => 'issues', :action => 'index', :project_id => '23',
69 :format => 'atom' }
72 :format => 'atom' }
70 )
73 )
71 assert_routing(
74 assert_routing(
72 { :method => 'get', :path => "/issues/64.xml" },
75 { :method => 'get', :path => "/projects/23/issues.xml" },
73 { :controller => 'issues', :action => 'show', :id => '64',
76 { :controller => 'issues', :action => 'index', :project_id => '23',
74 :format => 'xml' }
77 :format => 'xml' }
75 )
78 )
76 assert_routing(
79 assert_routing(
General Comments 0
You need to be logged in to leave comments. Login now