@@ -18,13 +18,18 | |||||
18 | require File.expand_path('../../../test_helper', __FILE__) |
|
18 | require File.expand_path('../../../test_helper', __FILE__) | |
19 |
|
19 | |||
20 | class RoutingVersionsTest < ActionController::IntegrationTest |
|
20 | class RoutingVersionsTest < ActionController::IntegrationTest | |
21 | def test_versions |
|
21 | def test_versions_scoped_under_project | |
22 | # /projects/foo/versions is /projects/foo/roadmap |
|
22 | # /projects/foo/versions is /projects/foo/roadmap | |
23 | assert_routing( |
|
23 | assert_routing( | |
24 | { :method => 'get', :path => "/projects/33/roadmap" }, |
|
24 | { :method => 'get', :path => "/projects/33/roadmap" }, | |
25 | { :controller => 'versions', :action => 'index', :project_id => '33' } |
|
25 | { :controller => 'versions', :action => 'index', :project_id => '33' } | |
26 | ) |
|
26 | ) | |
27 | assert_routing( |
|
27 | assert_routing( | |
|
28 | { :method => 'put', :path => "/projects/foo/versions/close_completed" }, | |||
|
29 | { :controller => 'versions', :action => 'close_completed', | |||
|
30 | :project_id => 'foo' } | |||
|
31 | ) | |||
|
32 | assert_routing( | |||
28 | { :method => 'get', :path => "/projects/foo/versions.xml" }, |
|
33 | { :method => 'get', :path => "/projects/foo/versions.xml" }, | |
29 | { :controller => 'versions', :action => 'index', |
|
34 | { :controller => 'versions', :action => 'index', | |
30 | :project_id => 'foo', :format => 'xml' } |
|
35 | :project_id => 'foo', :format => 'xml' } | |
@@ -54,6 +59,9 class RoutingVersionsTest < ActionController::IntegrationTest | |||||
54 | { :controller => 'versions', :action => 'create', |
|
59 | { :controller => 'versions', :action => 'create', | |
55 | :project_id => 'foo', :format => 'json' } |
|
60 | :project_id => 'foo', :format => 'json' } | |
56 | ) |
|
61 | ) | |
|
62 | end | |||
|
63 | ||||
|
64 | def test_versions | |||
57 | assert_routing( |
|
65 | assert_routing( | |
58 | { :method => 'get', :path => "/versions/1" }, |
|
66 | { :method => 'get', :path => "/versions/1" }, | |
59 | { :controller => 'versions', :action => 'show', :id => '1' } |
|
67 | { :controller => 'versions', :action => 'show', :id => '1' } | |
@@ -101,11 +109,6 class RoutingVersionsTest < ActionController::IntegrationTest | |||||
101 | :format => 'json' } |
|
109 | :format => 'json' } | |
102 | ) |
|
110 | ) | |
103 | assert_routing( |
|
111 | assert_routing( | |
104 | { :method => 'put', :path => "/projects/foo/versions/close_completed" }, |
|
|||
105 | { :controller => 'versions', :action => 'close_completed', |
|
|||
106 | :project_id => 'foo' } |
|
|||
107 | ) |
|
|||
108 | assert_routing( |
|
|||
109 | { :method => 'post', :path => "/versions/1/status_by" }, |
|
112 | { :method => 'post', :path => "/versions/1/status_by" }, | |
110 | { :controller => 'versions', :action => 'status_by', :id => '1' } |
|
113 | { :controller => 'versions', :action => 'status_by', :id => '1' } | |
111 | ) |
|
114 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now