##// END OF EJS Templates
test: replace "should_route" of "queries" to "assert_routing" at integration/routing_test.rb...
Toshi MARUYAMA -
r8140:06c8bbd34250
parent child
Show More
@@ -638,21 +638,43 class RoutingTest < ActionController::IntegrationTest
638 )
638 )
639 end
639 end
640
640
641 context "queries" do
641 def test_queries
642 should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml'
642 assert_routing(
643 should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json'
643 { :method => 'get', :path => "/queries.xml" },
644
644 { :controller => 'queries', :action => 'index', :format => 'xml' }
645 should_route :get, "/queries/new", :controller => 'queries', :action => 'new'
645 )
646 should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine'
646 assert_routing(
647
647 { :method => 'get', :path => "/queries.json" },
648 should_route :post, "/queries", :controller => 'queries', :action => 'create'
648 { :controller => 'queries', :action => 'index', :format => 'json' }
649 should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine'
649 )
650
650 assert_routing(
651 should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1'
651 { :method => 'get', :path => "/queries/new" },
652
652 { :controller => 'queries', :action => 'new' }
653 should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1'
653 )
654
654 assert_routing(
655 should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1'
655 { :method => 'get', :path => "/projects/redmine/queries/new" },
656 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
657 )
658 assert_routing(
659 { :method => 'post', :path => "/queries" },
660 { :controller => 'queries', :action => 'create' }
661 )
662 assert_routing(
663 { :method => 'post', :path => "/projects/redmine/queries" },
664 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
665 )
666 assert_routing(
667 { :method => 'get', :path => "/queries/1/edit" },
668 { :controller => 'queries', :action => 'edit', :id => '1' }
669 )
670 assert_routing(
671 { :method => 'put', :path => "/queries/1" },
672 { :controller => 'queries', :action => 'update', :id => '1' }
673 )
674 assert_routing(
675 { :method => 'delete', :path => "/queries/1" },
676 { :controller => 'queries', :action => 'destroy', :id => '1' }
677 )
656 end
678 end
657
679
658 def test_repositories
680 def test_repositories
General Comments 0
You need to be logged in to leave comments. Login now