@@ -150,22 +150,68 class RoutingTest < ActionController::IntegrationTest | |||||
150 | should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12' |
|
150 | should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12' | |
151 | end |
|
151 | end | |
152 |
|
152 | |||
|
153 | def test_issues_rest_actions | |||
|
154 | assert_routing( | |||
|
155 | { :method => 'get', :path => "/issues" }, | |||
|
156 | { :controller => 'issues', :action => 'index' } | |||
|
157 | ) | |||
|
158 | assert_routing( | |||
|
159 | { :method => 'get', :path => "/issues.pdf" }, | |||
|
160 | { :controller => 'issues', :action => 'index', :format => 'pdf' } | |||
|
161 | ) | |||
|
162 | assert_routing( | |||
|
163 | { :method => 'get', :path => "/issues.atom" }, | |||
|
164 | { :controller => 'issues', :action => 'index', :format => 'atom' } | |||
|
165 | ) | |||
|
166 | assert_routing( | |||
|
167 | { :method => 'get', :path => "/issues.xml" }, | |||
|
168 | { :controller => 'issues', :action => 'index', :format => 'xml' } | |||
|
169 | ) | |||
|
170 | assert_routing( | |||
|
171 | { :method => 'get', :path => "/projects/23/issues" }, | |||
|
172 | { :controller => 'issues', :action => 'index', :project_id => '23' } | |||
|
173 | ) | |||
|
174 | assert_routing( | |||
|
175 | { :method => 'get', :path => "/projects/23/issues.pdf" }, | |||
|
176 | { :controller => 'issues', :action => 'index', :project_id => '23', | |||
|
177 | :format => 'pdf' } | |||
|
178 | ) | |||
|
179 | assert_routing( | |||
|
180 | { :method => 'get', :path => "/projects/23/issues.atom" }, | |||
|
181 | { :controller => 'issues', :action => 'index', :project_id => '23', | |||
|
182 | :format => 'atom' } | |||
|
183 | ) | |||
|
184 | assert_routing( | |||
|
185 | { :method => 'get', :path => "/projects/23/issues.xml" }, | |||
|
186 | { :controller => 'issues', :action => 'index', :project_id => '23', | |||
|
187 | :format => 'xml' } | |||
|
188 | ) | |||
|
189 | assert_routing( | |||
|
190 | { :method => 'get', :path => "/issues/64" }, | |||
|
191 | { :controller => 'issues', :action => 'show', :id => '64' } | |||
|
192 | ) | |||
|
193 | assert_routing( | |||
|
194 | { :method => 'get', :path => "/issues/64.pdf" }, | |||
|
195 | { :controller => 'issues', :action => 'show', :id => '64', | |||
|
196 | :format => 'pdf' } | |||
|
197 | ) | |||
|
198 | assert_routing( | |||
|
199 | { :method => 'get', :path => "/issues/64.atom" }, | |||
|
200 | { :controller => 'issues', :action => 'show', :id => '64', | |||
|
201 | :format => 'atom' } | |||
|
202 | ) | |||
|
203 | assert_routing( | |||
|
204 | { :method => 'get', :path => "/issues/64.xml" }, | |||
|
205 | { :controller => 'issues', :action => 'show', :id => '64', | |||
|
206 | :format => 'xml' } | |||
|
207 | ) | |||
|
208 | assert_routing( | |||
|
209 | { :method => 'get', :path => "/projects/23/issues/new" }, | |||
|
210 | { :controller => 'issues', :action => 'new', :project_id => '23' } | |||
|
211 | ) | |||
|
212 | end | |||
|
213 | ||||
153 | context "issues" do |
|
214 | context "issues" do | |
154 | # REST actions |
|
|||
155 | should_route :get, "/issues", :controller => 'issues', :action => 'index' |
|
|||
156 | should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf' |
|
|||
157 | should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom' |
|
|||
158 | should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml' |
|
|||
159 | should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23' |
|
|||
160 | should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf' |
|
|||
161 | should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom' |
|
|||
162 | should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml' |
|
|||
163 | should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64' |
|
|||
164 | should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf' |
|
|||
165 | should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom' |
|
|||
166 | should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml' |
|
|||
167 |
|
||||
168 | should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' |
|
|||
169 | # issue form update |
|
215 | # issue form update | |
170 | should_route :post, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' |
|
216 | should_route :post, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' | |
171 | should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23' |
|
217 | should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23' |
General Comments 0
You need to be logged in to leave comments.
Login now