@@ -362,15 +362,40 class RoutingTest < ActionController::IntegrationTest | |||||
362 | ) |
|
362 | ) | |
363 | end |
|
363 | end | |
364 |
|
364 | |||
365 |
|
|
365 | def test_messages | |
366 | should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22' |
|
366 | assert_routing( | |
367 | should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
367 | { :method => 'get', :path => "/boards/22/topics/2" }, | |
368 |
|
|
368 | { :controller => 'messages', :action => 'show', :id => '2', | |
369 |
|
369 | :board_id => '22' } | ||
370 | should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
370 | ) | |
371 | should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' |
|
371 | assert_routing( | |
372 | should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22' |
|
372 | { :method => 'get', :path => "/boards/lala/topics/new" }, | |
373 |
|
|
373 | { :controller => 'messages', :action => 'new', :board_id => 'lala' } | |
|
374 | ) | |||
|
375 | assert_routing( | |||
|
376 | { :method => 'get', :path => "/boards/lala/topics/22/edit" }, | |||
|
377 | { :controller => 'messages', :action => 'edit', :id => '22', | |||
|
378 | :board_id => 'lala' } | |||
|
379 | ) | |||
|
380 | assert_routing( | |||
|
381 | { :method => 'post', :path => "/boards/lala/topics/new" }, | |||
|
382 | { :controller => 'messages', :action => 'new', :board_id => 'lala' } | |||
|
383 | ) | |||
|
384 | assert_routing( | |||
|
385 | { :method => 'post', :path => "/boards/lala/topics/22/edit" }, | |||
|
386 | { :controller => 'messages', :action => 'edit', :id => '22', | |||
|
387 | :board_id => 'lala' } | |||
|
388 | ) | |||
|
389 | assert_routing( | |||
|
390 | { :method => 'post', :path => "/boards/22/topics/555/replies" }, | |||
|
391 | { :controller => 'messages', :action => 'reply', :id => '555', | |||
|
392 | :board_id => '22' } | |||
|
393 | ) | |||
|
394 | assert_routing( | |||
|
395 | { :method => 'post', :path => "/boards/22/topics/555/destroy" }, | |||
|
396 | { :controller => 'messages', :action => 'destroy', :id => '555', | |||
|
397 | :board_id => '22' } | |||
|
398 | ) | |||
374 | end |
|
399 | end | |
375 |
|
400 | |||
376 | context "news" do |
|
401 | context "news" do |
General Comments 0
You need to be logged in to leave comments.
Login now