##// END OF EJS Templates
test: replace "should_route" of "timelogs (scoped under project and issues)" to "assert_routing" at integration/routing_test.rb...
Toshi MARUYAMA -
r8139:a59e857d5169
parent child
Show More
@@ -912,22 +912,71 class RoutingTest < ActionController::IntegrationTest
912 )
912 )
913 end
913 end
914
914
915 context "timelogs (scoped under project and issues)" do
915 def test_timelogs_scoped_under_project_and_issues
916 should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
916 assert_routing(
917 should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
917 { :method => 'get',
918 should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
918 :path => "/projects/ecookbook/issues/234/time_entries" },
919 should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
919 { :controller => 'timelog', :action => 'index',
920 should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
920 :issue_id => '234', :project_id => 'ecookbook' }
921
921 )
922 should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
922 assert_routing(
923
923 { :method => 'get',
924 should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
924 :path => "/projects/ecookbook/issues/234/time_entries.csv" },
925
925 { :controller => 'timelog', :action => 'index',
926 should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
926 :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' }
927
927 )
928 should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
928 assert_routing(
929 should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
929 { :method => 'get',
930 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
930 :path => "/projects/ecookbook/issues/234/time_entries.atom" },
931 { :controller => 'timelog', :action => 'index',
932 :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' }
933 )
934 assert_routing(
935 { :method => 'get',
936 :path => "/projects/ecookbook/issues/234/time_entries/new" },
937 { :controller => 'timelog', :action => 'new',
938 :issue_id => '234', :project_id => 'ecookbook' }
939 )
940 assert_routing(
941 { :method => 'get',
942 :path => "/projects/ecookbook/issues/234/time_entries/22/edit" },
943 { :controller => 'timelog', :action => 'edit', :id => '22',
944 :issue_id => '234', :project_id => 'ecookbook' }
945 )
946 assert_routing(
947 { :method => 'post',
948 :path => "/projects/ecookbook/issues/234/time_entries" },
949 { :controller => 'timelog', :action => 'create',
950 :issue_id => '234', :project_id => 'ecookbook' }
951 )
952 assert_routing(
953 { :method => 'put',
954 :path => "/projects/ecookbook/issues/234/time_entries/22" },
955 { :controller => 'timelog', :action => 'update', :id => '22',
956 :issue_id => '234', :project_id => 'ecookbook' }
957 )
958 assert_routing(
959 { :method => 'delete',
960 :path => "/projects/ecookbook/issues/234/time_entries/55" },
961 { :controller => 'timelog', :action => 'destroy', :id => '55',
962 :issue_id => '234', :project_id => 'ecookbook' }
963 )
964 assert_routing(
965 { :method => 'get',
966 :path => "/time_entries/report" },
967 { :controller => 'timelog', :action => 'report' }
968 )
969 assert_routing(
970 { :method => 'get',
971 :path => "/projects/567/time_entries/report" },
972 { :controller => 'timelog', :action => 'report', :project_id => '567' }
973 )
974 assert_routing(
975 { :method => 'get',
976 :path => "/projects/567/time_entries/report.csv" },
977 { :controller => 'timelog', :action => 'report', :project_id => '567',
978 :format => 'csv' }
979 )
931 end
980 end
932
981
933 def test_users
982 def test_users
General Comments 0
You need to be logged in to leave comments. Login now