@@ -123,17 +123,39 class RoutingTest < ActionController::IntegrationTest | |||||
123 | ) |
|
123 | ) | |
124 | end |
|
124 | end | |
125 |
|
125 | |||
126 |
|
|
126 | def test_documents | |
127 | should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567' |
|
127 | assert_routing( | |
128 | should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567' |
|
128 | { :method => 'get', :path => "/projects/567/documents" }, | |
129 |
|
|
129 | { :controller => 'documents', :action => 'index', :project_id => '567' } | |
130 | should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22' |
|
130 | ) | |
131 |
|
131 | assert_routing( | ||
132 | should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567' |
|
132 | { :method => 'get', :path => "/projects/567/documents/new" }, | |
133 |
|
|
133 | { :controller => 'documents', :action => 'new', :project_id => '567' } | |
134 | should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22' |
|
134 | ) | |
135 |
|
135 | assert_routing( | ||
136 | should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22' |
|
136 | { :method => 'get', :path => "/documents/22" }, | |
|
137 | { :controller => 'documents', :action => 'show', :id => '22' } | |||
|
138 | ) | |||
|
139 | assert_routing( | |||
|
140 | { :method => 'get', :path => "/documents/22/edit" }, | |||
|
141 | { :controller => 'documents', :action => 'edit', :id => '22' } | |||
|
142 | ) | |||
|
143 | assert_routing( | |||
|
144 | { :method => 'post', :path => "/projects/567/documents" }, | |||
|
145 | { :controller => 'documents', :action => 'create', :project_id => '567' } | |||
|
146 | ) | |||
|
147 | assert_routing( | |||
|
148 | { :method => 'put', :path => "/documents/22" }, | |||
|
149 | { :controller => 'documents', :action => 'update', :id => '22' } | |||
|
150 | ) | |||
|
151 | assert_routing( | |||
|
152 | { :method => 'delete', :path => "/documents/22" }, | |||
|
153 | { :controller => 'documents', :action => 'destroy', :id => '22' } | |||
|
154 | ) | |||
|
155 | assert_routing( | |||
|
156 | { :method => 'post', :path => "/documents/22/add_attachment" }, | |||
|
157 | { :controller => 'documents', :action => 'add_attachment', :id => '22' } | |||
|
158 | ) | |||
137 | end |
|
159 | end | |
138 |
|
160 | |||
139 | context "roles" do |
|
161 | context "roles" do |
General Comments 0
You need to be logged in to leave comments.
Login now