##// END OF EJS Templates
test: route: split repository route test...
Toshi MARUYAMA -
r8284:6178780a3d80
parent child
Show More
@@ -29,6 +29,9 class RoutingRepositoriesTest < ActionController::IntegrationTest
29 29 :path => "/projects/redmine/repository/edit" },
30 30 { :controller => 'repositories', :action => 'edit', :id => 'redmine' }
31 31 )
32 end
33
34 def test_repositories_revisions
32 35 assert_routing(
33 36 { :method => 'get',
34 37 :path => "/projects/redmine/repository/revisions" },
@@ -60,45 +63,48 class RoutingRepositoriesTest < ActionController::IntegrationTest
60 63 )
61 64 assert_routing(
62 65 { :method => 'get',
63 :path => "/projects/redmine/repository/diff/path/to/file.c" },
66 :path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" },
64 67 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
65 :path => %w[path to file.c] }
68 :path => %w[path to file.c], :rev => '2' }
66 69 )
67 70 assert_routing(
68 71 { :method => 'get',
69 :path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" },
70 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
72 :path => "/projects/redmine/repository/revisions/2/entry/path/to/file.c" },
73 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
71 74 :path => %w[path to file.c], :rev => '2' }
72 75 )
73 76 assert_routing(
74 77 { :method => 'get',
75 :path => "/projects/redmine/repository/browse/path/to/file.c" },
76 { :controller => 'repositories', :action => 'browse', :id => 'redmine',
77 :path => %w[path to file.c] }
78 :path => "/projects/redmine/repository/revisions/2/raw/path/to/file.c" },
79 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
80 :path => %w[path to file.c], :rev => '2', :format => 'raw' }
78 81 )
82 end
83
84 def test_repositories_etc
79 85 assert_routing(
80 86 { :method => 'get',
81 :path => "/projects/redmine/repository/entry/path/to/file.c" },
82 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
87 :path => "/projects/redmine/repository/diff/path/to/file.c" },
88 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
83 89 :path => %w[path to file.c] }
84 90 )
85 91 assert_routing(
86 92 { :method => 'get',
87 :path => "/projects/redmine/repository/revisions/2/entry/path/to/file.c" },
88 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
89 :path => %w[path to file.c], :rev => '2' }
93 :path => "/projects/redmine/repository/browse/path/to/file.c" },
94 { :controller => 'repositories', :action => 'browse', :id => 'redmine',
95 :path => %w[path to file.c] }
90 96 )
91 97 assert_routing(
92 98 { :method => 'get',
93 :path => "/projects/redmine/repository/raw/path/to/file.c" },
99 :path => "/projects/redmine/repository/entry/path/to/file.c" },
94 100 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
95 :path => %w[path to file.c], :format => 'raw' }
101 :path => %w[path to file.c] }
96 102 )
97 103 assert_routing(
98 104 { :method => 'get',
99 :path => "/projects/redmine/repository/revisions/2/raw/path/to/file.c" },
105 :path => "/projects/redmine/repository/raw/path/to/file.c" },
100 106 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
101 :path => %w[path to file.c], :rev => '2', :format => 'raw' }
107 :path => %w[path to file.c], :format => 'raw' }
102 108 )
103 109 assert_routing(
104 110 { :method => 'get',
General Comments 0
You need to be logged in to leave comments. Login now