Commit 40bca5246b6e1cea36932c5e0eae89a63d8f0a03
1 parent
2ed7cbfb
Exists in
master
and in
4 other branches
Fix routing/controller specs for refactored controllers
Showing
6 changed files
with
100 additions
and
100 deletions
Show diff stats
spec/controllers/blob_controller_spec.rb
spec/controllers/commit_controller_spec.rb
spec/controllers/commits_controller_spec.rb
spec/controllers/merge_requests_controller_spec.rb
1 | 1 | require 'spec_helper' |
2 | 2 | |
3 | -describe MergeRequestsController do | |
3 | +describe Projects::MergeRequestsController do | |
4 | 4 | let(:project) { create(:project_with_code) } |
5 | 5 | let(:user) { create(:user) } |
6 | 6 | let(:merge_request) { create(:merge_request_with_diffs, project: project, target_branch: "bcf03b5d~3", source_branch: "bcf03b5d") } |
... | ... | @@ -8,7 +8,7 @@ describe MergeRequestsController do |
8 | 8 | before do |
9 | 9 | sign_in(user) |
10 | 10 | project.team << [user, :master] |
11 | - MergeRequestsController.any_instance.stub(validates_merge_request: true) | |
11 | + Projects::MergeRequestsController.any_instance.stub(validates_merge_request: true) | |
12 | 12 | end |
13 | 13 | |
14 | 14 | describe "#show" do | ... | ... |
spec/controllers/tree_controller_spec.rb
spec/routing/project_routing_spec.rb
... | ... | @@ -25,31 +25,31 @@ shared_examples "RESTful project resources" do |
25 | 25 | let(:actions) { [:index, :create, :new, :edit, :show, :update, :destroy] } |
26 | 26 | |
27 | 27 | it "to #index" do |
28 | - get("/gitlabhq/#{controller}").should route_to("#{controller}#index", project_id: 'gitlabhq') if actions.include?(:index) | |
28 | + get("/gitlabhq/#{controller}").should route_to("projects/#{controller}#index", project_id: 'gitlabhq') if actions.include?(:index) | |
29 | 29 | end |
30 | 30 | |
31 | 31 | it "to #create" do |
32 | - post("/gitlabhq/#{controller}").should route_to("#{controller}#create", project_id: 'gitlabhq') if actions.include?(:create) | |
32 | + post("/gitlabhq/#{controller}").should route_to("projects/#{controller}#create", project_id: 'gitlabhq') if actions.include?(:create) | |
33 | 33 | end |
34 | 34 | |
35 | 35 | it "to #new" do |
36 | - get("/gitlabhq/#{controller}/new").should route_to("#{controller}#new", project_id: 'gitlabhq') if actions.include?(:new) | |
36 | + get("/gitlabhq/#{controller}/new").should route_to("projects/#{controller}#new", project_id: 'gitlabhq') if actions.include?(:new) | |
37 | 37 | end |
38 | 38 | |
39 | 39 | it "to #edit" do |
40 | - get("/gitlabhq/#{controller}/1/edit").should route_to("#{controller}#edit", project_id: 'gitlabhq', id: '1') if actions.include?(:edit) | |
40 | + get("/gitlabhq/#{controller}/1/edit").should route_to("projects/#{controller}#edit", project_id: 'gitlabhq', id: '1') if actions.include?(:edit) | |
41 | 41 | end |
42 | 42 | |
43 | 43 | it "to #show" do |
44 | - get("/gitlabhq/#{controller}/1").should route_to("#{controller}#show", project_id: 'gitlabhq', id: '1') if actions.include?(:show) | |
44 | + get("/gitlabhq/#{controller}/1").should route_to("projects/#{controller}#show", project_id: 'gitlabhq', id: '1') if actions.include?(:show) | |
45 | 45 | end |
46 | 46 | |
47 | 47 | it "to #update" do |
48 | - put("/gitlabhq/#{controller}/1").should route_to("#{controller}#update", project_id: 'gitlabhq', id: '1') if actions.include?(:update) | |
48 | + put("/gitlabhq/#{controller}/1").should route_to("projects/#{controller}#update", project_id: 'gitlabhq', id: '1') if actions.include?(:update) | |
49 | 49 | end |
50 | 50 | |
51 | 51 | it "to #destroy" do |
52 | - delete("/gitlabhq/#{controller}/1").should route_to("#{controller}#destroy", project_id: 'gitlabhq', id: '1') if actions.include?(:destroy) | |
52 | + delete("/gitlabhq/#{controller}/1").should route_to("projects/#{controller}#destroy", project_id: 'gitlabhq', id: '1') if actions.include?(:destroy) | |
53 | 53 | end |
54 | 54 | end |
55 | 55 | |
... | ... | @@ -76,7 +76,7 @@ describe ProjectsController, "routing" do |
76 | 76 | end |
77 | 77 | |
78 | 78 | it "to #wall" do |
79 | - get("/gitlabhq/wall").should route_to('walls#show', project_id: 'gitlabhq') | |
79 | + get("/gitlabhq/wall").should route_to('projects/walls#show', project_id: 'gitlabhq') | |
80 | 80 | end |
81 | 81 | |
82 | 82 | it "to #edit" do |
... | ... | @@ -100,19 +100,19 @@ describe ProjectsController, "routing" do |
100 | 100 | end |
101 | 101 | end |
102 | 102 | |
103 | -# pages_project_wikis GET /:project_id/wikis/pages(.:format) wikis#pages | |
104 | -# history_project_wiki GET /:project_id/wikis/:id/history(.:format) wikis#history | |
105 | -# project_wikis POST /:project_id/wikis(.:format) wikis#create | |
106 | -# edit_project_wiki GET /:project_id/wikis/:id/edit(.:format) wikis#edit | |
107 | -# project_wiki GET /:project_id/wikis/:id(.:format) wikis#show | |
108 | -# DELETE /:project_id/wikis/:id(.:format) wikis#destroy | |
109 | -describe WikisController, "routing" do | |
103 | +# pages_project_wikis GET /:project_id/wikis/pages(.:format) projects/wikis#pages | |
104 | +# history_project_wiki GET /:project_id/wikis/:id/history(.:format) projects/wikis#history | |
105 | +# project_wikis POST /:project_id/wikis(.:format) projects/wikis#create | |
106 | +# edit_project_wiki GET /:project_id/wikis/:id/edit(.:format) projects/wikis#edit | |
107 | +# project_wiki GET /:project_id/wikis/:id(.:format) projects/wikis#show | |
108 | +# DELETE /:project_id/wikis/:id(.:format) projects/wikis#destroy | |
109 | +describe Projects::WikisController, "routing" do | |
110 | 110 | it "to #pages" do |
111 | - get("/gitlabhq/wikis/pages").should route_to('wikis#pages', project_id: 'gitlabhq') | |
111 | + get("/gitlabhq/wikis/pages").should route_to('projects/wikis#pages', project_id: 'gitlabhq') | |
112 | 112 | end |
113 | 113 | |
114 | 114 | it "to #history" do |
115 | - get("/gitlabhq/wikis/1/history").should route_to('wikis#history', project_id: 'gitlabhq', id: '1') | |
115 | + get("/gitlabhq/wikis/1/history").should route_to('projects/wikis#history', project_id: 'gitlabhq', id: '1') | |
116 | 116 | end |
117 | 117 | |
118 | 118 | it_behaves_like "RESTful project resources" do |
... | ... | @@ -121,25 +121,25 @@ describe WikisController, "routing" do |
121 | 121 | end |
122 | 122 | end |
123 | 123 | |
124 | -# branches_project_repository GET /:project_id/repository/branches(.:format) repositories#branches | |
125 | -# tags_project_repository GET /:project_id/repository/tags(.:format) repositories#tags | |
126 | -# archive_project_repository GET /:project_id/repository/archive(.:format) repositories#archive | |
127 | -# edit_project_repository GET /:project_id/repository/edit(.:format) repositories#edit | |
128 | -describe RepositoriesController, "routing" do | |
124 | +# branches_project_repository GET /:project_id/repository/branches(.:format) projects/repositories#branches | |
125 | +# tags_project_repository GET /:project_id/repository/tags(.:format) projects/repositories#tags | |
126 | +# archive_project_repository GET /:project_id/repository/archive(.:format) projects/repositories#archive | |
127 | +# edit_project_repository GET /:project_id/repository/edit(.:format) projects/repositories#edit | |
128 | +describe Projects::RepositoriesController, "routing" do | |
129 | 129 | it "to #branches" do |
130 | - get("/gitlabhq/repository/branches").should route_to('repositories#branches', project_id: 'gitlabhq') | |
130 | + get("/gitlabhq/repository/branches").should route_to('projects/repositories#branches', project_id: 'gitlabhq') | |
131 | 131 | end |
132 | 132 | |
133 | 133 | it "to #tags" do |
134 | - get("/gitlabhq/repository/tags").should route_to('repositories#tags', project_id: 'gitlabhq') | |
134 | + get("/gitlabhq/repository/tags").should route_to('projects/repositories#tags', project_id: 'gitlabhq') | |
135 | 135 | end |
136 | 136 | |
137 | 137 | it "to #archive" do |
138 | - get("/gitlabhq/repository/archive").should route_to('repositories#archive', project_id: 'gitlabhq') | |
138 | + get("/gitlabhq/repository/archive").should route_to('projects/repositories#archive', project_id: 'gitlabhq') | |
139 | 139 | end |
140 | 140 | |
141 | 141 | it "to #show" do |
142 | - get("/gitlabhq/repository").should route_to('repositories#show', project_id: 'gitlabhq') | |
142 | + get("/gitlabhq/repository").should route_to('projects/repositories#show', project_id: 'gitlabhq') | |
143 | 143 | end |
144 | 144 | end |
145 | 145 | |
... | ... | @@ -150,7 +150,7 @@ end |
150 | 150 | # project_deploy_key GET /:project_id/deploy_keys/:id(.:format) deploy_keys#show |
151 | 151 | # PUT /:project_id/deploy_keys/:id(.:format) deploy_keys#update |
152 | 152 | # DELETE /:project_id/deploy_keys/:id(.:format) deploy_keys#destroy |
153 | -describe DeployKeysController, "routing" do | |
153 | +describe Projects::DeployKeysController, "routing" do | |
154 | 154 | it_behaves_like "RESTful project resources" do |
155 | 155 | let(:controller) { 'deploy_keys' } |
156 | 156 | end |
... | ... | @@ -159,7 +159,7 @@ end |
159 | 159 | # project_protected_branches GET /:project_id/protected_branches(.:format) protected_branches#index |
160 | 160 | # POST /:project_id/protected_branches(.:format) protected_branches#create |
161 | 161 | # project_protected_branch DELETE /:project_id/protected_branches/:id(.:format) protected_branches#destroy |
162 | -describe ProtectedBranchesController, "routing" do | |
162 | +describe Projects::ProtectedBranchesController, "routing" do | |
163 | 163 | it_behaves_like "RESTful project resources" do |
164 | 164 | let(:actions) { [:index, :create, :destroy] } |
165 | 165 | let(:controller) { 'protected_branches' } |
... | ... | @@ -169,58 +169,58 @@ end |
169 | 169 | # switch_project_refs GET /:project_id/refs/switch(.:format) refs#switch |
170 | 170 | # logs_tree_project_ref GET /:project_id/refs/:id/logs_tree(.:format) refs#logs_tree |
171 | 171 | # logs_file_project_ref GET /:project_id/refs/:id/logs_tree/:path(.:format) refs#logs_tree |
172 | -describe RefsController, "routing" do | |
172 | +describe Projects::RefsController, "routing" do | |
173 | 173 | it "to #switch" do |
174 | - get("/gitlabhq/refs/switch").should route_to('refs#switch', project_id: 'gitlabhq') | |
174 | + get("/gitlabhq/refs/switch").should route_to('projects/refs#switch', project_id: 'gitlabhq') | |
175 | 175 | end |
176 | 176 | |
177 | 177 | it "to #logs_tree" do |
178 | - get("/gitlabhq/refs/stable/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable') | |
179 | - get("/gitlabhq/refs/feature%2345/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45') | |
180 | - get("/gitlabhq/refs/feature%2B45/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature+45') | |
181 | - get("/gitlabhq/refs/stable/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz') | |
182 | - get("/gitlabhq/refs/feature%2345/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45', path: 'foo/bar/baz') | |
183 | - get("/gitlabhq/refs/feature%2B45/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'feature+45', path: 'foo/bar/baz') | |
184 | - get("/gitlab/gitlabhq/refs/stable/logs_tree/files.scss").should route_to('refs#logs_tree', project_id: 'gitlab/gitlabhq', id: 'stable', path: 'files.scss') | |
178 | + get("/gitlabhq/refs/stable/logs_tree").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'stable') | |
179 | + get("/gitlabhq/refs/feature%2345/logs_tree").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45') | |
180 | + get("/gitlabhq/refs/feature%2B45/logs_tree").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'feature+45') | |
181 | + get("/gitlabhq/refs/stable/logs_tree/foo/bar/baz").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz') | |
182 | + get("/gitlabhq/refs/feature%2345/logs_tree/foo/bar/baz").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'feature#45', path: 'foo/bar/baz') | |
183 | + get("/gitlabhq/refs/feature%2B45/logs_tree/foo/bar/baz").should route_to('projects/refs#logs_tree', project_id: 'gitlabhq', id: 'feature+45', path: 'foo/bar/baz') | |
184 | + get("/gitlab/gitlabhq/refs/stable/logs_tree/files.scss").should route_to('projects/refs#logs_tree', project_id: 'gitlab/gitlabhq', id: 'stable', path: 'files.scss') | |
185 | 185 | end |
186 | 186 | end |
187 | 187 | |
188 | -# diffs_project_merge_request GET /:project_id/merge_requests/:id/diffs(.:format) merge_requests#diffs | |
189 | -# automerge_project_merge_request GET /:project_id/merge_requests/:id/automerge(.:format) merge_requests#automerge | |
190 | -# automerge_check_project_merge_request GET /:project_id/merge_requests/:id/automerge_check(.:format) merge_requests#automerge_check | |
191 | -# branch_from_project_merge_requests GET /:project_id/merge_requests/branch_from(.:format) merge_requests#branch_from | |
192 | -# branch_to_project_merge_requests GET /:project_id/merge_requests/branch_to(.:format) merge_requests#branch_to | |
193 | -# project_merge_requests GET /:project_id/merge_requests(.:format) merge_requests#index | |
194 | -# POST /:project_id/merge_requests(.:format) merge_requests#create | |
195 | -# new_project_merge_request GET /:project_id/merge_requests/new(.:format) merge_requests#new | |
196 | -# edit_project_merge_request GET /:project_id/merge_requests/:id/edit(.:format) merge_requests#edit | |
197 | -# project_merge_request GET /:project_id/merge_requests/:id(.:format) merge_requests#show | |
198 | -# PUT /:project_id/merge_requests/:id(.:format) merge_requests#update | |
199 | -# DELETE /:project_id/merge_requests/:id(.:format) merge_requests#destroy | |
200 | -describe MergeRequestsController, "routing" do | |
188 | +# diffs_project_merge_request GET /:project_id/merge_requests/:id/diffs(.:format) projects/merge_requests#diffs | |
189 | +# automerge_project_merge_request GET /:project_id/merge_requests/:id/automerge(.:format) projects/merge_requests#automerge | |
190 | +# automerge_check_project_merge_request GET /:project_id/merge_requests/:id/automerge_check(.:format) projects/merge_requests#automerge_check | |
191 | +# branch_from_project_merge_requests GET /:project_id/merge_requests/branch_from(.:format) projects/merge_requests#branch_from | |
192 | +# branch_to_project_merge_requests GET /:project_id/merge_requests/branch_to(.:format) projects/merge_requests#branch_to | |
193 | +# project_merge_requests GET /:project_id/merge_requests(.:format) projects/merge_requests#index | |
194 | +# POST /:project_id/merge_requests(.:format) projects/merge_requests#create | |
195 | +# new_project_merge_request GET /:project_id/merge_requests/new(.:format) projects/merge_requests#new | |
196 | +# edit_project_merge_request GET /:project_id/merge_requests/:id/edit(.:format) projects/merge_requests#edit | |
197 | +# project_merge_request GET /:project_id/merge_requests/:id(.:format) projects/merge_requests#show | |
198 | +# PUT /:project_id/merge_requests/:id(.:format) projects/merge_requests#update | |
199 | +# DELETE /:project_id/merge_requests/:id(.:format) projects/merge_requests#destroy | |
200 | +describe Projects::MergeRequestsController, "routing" do | |
201 | 201 | it "to #diffs" do |
202 | - get("/gitlabhq/merge_requests/1/diffs").should route_to('merge_requests#diffs', project_id: 'gitlabhq', id: '1') | |
202 | + get("/gitlabhq/merge_requests/1/diffs").should route_to('projects/merge_requests#diffs', project_id: 'gitlabhq', id: '1') | |
203 | 203 | end |
204 | 204 | |
205 | 205 | it "to #automerge" do |
206 | - get("/gitlabhq/merge_requests/1/automerge").should route_to('merge_requests#automerge', project_id: 'gitlabhq', id: '1') | |
206 | + get("/gitlabhq/merge_requests/1/automerge").should route_to('projects/merge_requests#automerge', project_id: 'gitlabhq', id: '1') | |
207 | 207 | end |
208 | 208 | |
209 | 209 | it "to #automerge_check" do |
210 | - get("/gitlabhq/merge_requests/1/automerge_check").should route_to('merge_requests#automerge_check', project_id: 'gitlabhq', id: '1') | |
210 | + get("/gitlabhq/merge_requests/1/automerge_check").should route_to('projects/merge_requests#automerge_check', project_id: 'gitlabhq', id: '1') | |
211 | 211 | end |
212 | 212 | |
213 | 213 | it "to #branch_from" do |
214 | - get("/gitlabhq/merge_requests/branch_from").should route_to('merge_requests#branch_from', project_id: 'gitlabhq') | |
214 | + get("/gitlabhq/merge_requests/branch_from").should route_to('projects/merge_requests#branch_from', project_id: 'gitlabhq') | |
215 | 215 | end |
216 | 216 | |
217 | 217 | it "to #branch_to" do |
218 | - get("/gitlabhq/merge_requests/branch_to").should route_to('merge_requests#branch_to', project_id: 'gitlabhq') | |
218 | + get("/gitlabhq/merge_requests/branch_to").should route_to('projects/merge_requests#branch_to', project_id: 'gitlabhq') | |
219 | 219 | end |
220 | 220 | |
221 | 221 | it "to #show" do |
222 | - get("/gitlabhq/merge_requests/1.diff").should route_to('merge_requests#show', project_id: 'gitlabhq', id: '1', format: 'diff') | |
223 | - get("/gitlabhq/merge_requests/1.patch").should route_to('merge_requests#show', project_id: 'gitlabhq', id: '1', format: 'patch') | |
222 | + get("/gitlabhq/merge_requests/1.diff").should route_to('projects/merge_requests#show', project_id: 'gitlabhq', id: '1', format: 'diff') | |
223 | + get("/gitlabhq/merge_requests/1.patch").should route_to('projects/merge_requests#show', project_id: 'gitlabhq', id: '1', format: 'patch') | |
224 | 224 | end |
225 | 225 | |
226 | 226 | it_behaves_like "RESTful project resources" do |
... | ... | @@ -275,9 +275,9 @@ end |
275 | 275 | # project_hooks GET /:project_id/hooks(.:format) hooks#index |
276 | 276 | # POST /:project_id/hooks(.:format) hooks#create |
277 | 277 | # project_hook DELETE /:project_id/hooks/:id(.:format) hooks#destroy |
278 | -describe HooksController, "routing" do | |
278 | +describe Projects::HooksController, "routing" do | |
279 | 279 | it "to #test" do |
280 | - get("/gitlabhq/hooks/1/test").should route_to('hooks#test', project_id: 'gitlabhq', id: '1') | |
280 | + get("/gitlabhq/hooks/1/test").should route_to('projects/hooks#test', project_id: 'gitlabhq', id: '1') | |
281 | 281 | end |
282 | 282 | |
283 | 283 | it_behaves_like "RESTful project resources" do |
... | ... | @@ -287,12 +287,12 @@ describe HooksController, "routing" do |
287 | 287 | end |
288 | 288 | |
289 | 289 | # project_commit GET /:project_id/commit/:id(.:format) commit#show {id: /[[:alnum:]]{6,40}/, project_id: /[^\/]+/} |
290 | -describe CommitController, "routing" do | |
290 | +describe Projects::CommitController, "routing" do | |
291 | 291 | it "to #show" do |
292 | - get("/gitlabhq/commit/4246fb").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb') | |
293 | - get("/gitlabhq/commit/4246fb.diff").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'diff') | |
294 | - get("/gitlabhq/commit/4246fb.patch").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'patch') | |
295 | - get("/gitlabhq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fbd13872934f72a8fd0d6fb1317b47b59cb5') | |
292 | + get("/gitlabhq/commit/4246fb").should route_to('projects/commit#show', project_id: 'gitlabhq', id: '4246fb') | |
293 | + get("/gitlabhq/commit/4246fb.diff").should route_to('projects/commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'diff') | |
294 | + get("/gitlabhq/commit/4246fb.patch").should route_to('projects/commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'patch') | |
295 | + get("/gitlabhq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5").should route_to('projects/commit#show', project_id: 'gitlabhq', id: '4246fbd13872934f72a8fd0d6fb1317b47b59cb5') | |
296 | 296 | end |
297 | 297 | end |
298 | 298 | |
... | ... | @@ -300,14 +300,14 @@ end |
300 | 300 | # project_commits GET /:project_id/commits(.:format) commits#index |
301 | 301 | # POST /:project_id/commits(.:format) commits#create |
302 | 302 | # project_commit GET /:project_id/commits/:id(.:format) commits#show |
303 | -describe CommitsController, "routing" do | |
303 | +describe Projects::CommitsController, "routing" do | |
304 | 304 | it_behaves_like "RESTful project resources" do |
305 | 305 | let(:actions) { [:show] } |
306 | 306 | let(:controller) { 'commits' } |
307 | 307 | end |
308 | 308 | |
309 | 309 | it "to #show" do |
310 | - get("/gitlab/gitlabhq/commits/master.atom").should route_to('commits#show', project_id: 'gitlab/gitlabhq', id: "master", format: "atom") | |
310 | + get("/gitlab/gitlabhq/commits/master.atom").should route_to('projects/commits#show', project_id: 'gitlab/gitlabhq', id: "master", format: "atom") | |
311 | 311 | end |
312 | 312 | end |
313 | 313 | |
... | ... | @@ -318,7 +318,7 @@ end |
318 | 318 | # project_team_member GET /:project_id/team_members/:id(.:format) team_members#show |
319 | 319 | # PUT /:project_id/team_members/:id(.:format) team_members#update |
320 | 320 | # DELETE /:project_id/team_members/:id(.:format) team_members#destroy |
321 | -describe TeamMembersController, "routing" do | |
321 | +describe Projects::TeamMembersController, "routing" do | |
322 | 322 | it_behaves_like "RESTful project resources" do |
323 | 323 | let(:actions) { [:new, :create, :update, :destroy] } |
324 | 324 | let(:controller) { 'team_members' } |
... | ... | @@ -332,7 +332,7 @@ end |
332 | 332 | # project_milestone GET /:project_id/milestones/:id(.:format) milestones#show |
333 | 333 | # PUT /:project_id/milestones/:id(.:format) milestones#update |
334 | 334 | # DELETE /:project_id/milestones/:id(.:format) milestones#destroy |
335 | -describe MilestonesController, "routing" do | |
335 | +describe Projects::MilestonesController, "routing" do | |
336 | 336 | it_behaves_like "RESTful project resources" do |
337 | 337 | let(:controller) { 'milestones' } |
338 | 338 | let(:actions) { [:index, :create, :new, :edit, :show, :update] } |
... | ... | @@ -340,9 +340,9 @@ describe MilestonesController, "routing" do |
340 | 340 | end |
341 | 341 | |
342 | 342 | # project_labels GET /:project_id/labels(.:format) labels#index |
343 | -describe LabelsController, "routing" do | |
343 | +describe Projects::LabelsController, "routing" do | |
344 | 344 | it "to #index" do |
345 | - get("/gitlabhq/labels").should route_to('labels#index', project_id: 'gitlabhq') | |
345 | + get("/gitlabhq/labels").should route_to('projects/labels#index', project_id: 'gitlabhq') | |
346 | 346 | end |
347 | 347 | end |
348 | 348 | |
... | ... | @@ -356,9 +356,9 @@ end |
356 | 356 | # project_issue GET /:project_id/issues/:id(.:format) issues#show |
357 | 357 | # PUT /:project_id/issues/:id(.:format) issues#update |
358 | 358 | # DELETE /:project_id/issues/:id(.:format) issues#destroy |
359 | -describe IssuesController, "routing" do | |
359 | +describe Projects::IssuesController, "routing" do | |
360 | 360 | it "to #bulk_update" do |
361 | - post("/gitlabhq/issues/bulk_update").should route_to('issues#bulk_update', project_id: 'gitlabhq') | |
361 | + post("/gitlabhq/issues/bulk_update").should route_to('projects/issues#bulk_update', project_id: 'gitlabhq') | |
362 | 362 | end |
363 | 363 | |
364 | 364 | it_behaves_like "RESTful project resources" do |
... | ... | @@ -371,9 +371,9 @@ end |
371 | 371 | # project_notes GET /:project_id/notes(.:format) notes#index |
372 | 372 | # POST /:project_id/notes(.:format) notes#create |
373 | 373 | # project_note DELETE /:project_id/notes/:id(.:format) notes#destroy |
374 | -describe NotesController, "routing" do | |
374 | +describe Projects::NotesController, "routing" do | |
375 | 375 | it "to #preview" do |
376 | - post("/gitlabhq/notes/preview").should route_to('notes#preview', project_id: 'gitlabhq') | |
376 | + post("/gitlabhq/notes/preview").should route_to('projects/notes#preview', project_id: 'gitlabhq') | |
377 | 377 | end |
378 | 378 | |
379 | 379 | it_behaves_like "RESTful project resources" do |
... | ... | @@ -383,57 +383,57 @@ describe NotesController, "routing" do |
383 | 383 | end |
384 | 384 | |
385 | 385 | # project_blame GET /:project_id/blame/:id(.:format) blame#show {id: /.+/, project_id: /[^\/]+/} |
386 | -describe BlameController, "routing" do | |
386 | +describe Projects::BlameController, "routing" do | |
387 | 387 | it "to #show" do |
388 | - get("/gitlabhq/blame/master/app/models/project.rb").should route_to('blame#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') | |
389 | - get("/gitlab/gitlabhq/blame/master/files.scss").should route_to('blame#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') | |
388 | + get("/gitlabhq/blame/master/app/models/project.rb").should route_to('projects/blame#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') | |
389 | + get("/gitlab/gitlabhq/blame/master/files.scss").should route_to('projects/blame#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') | |
390 | 390 | end |
391 | 391 | end |
392 | 392 | |
393 | 393 | # project_blob GET /:project_id/blob/:id(.:format) blob#show {id: /.+/, project_id: /[^\/]+/} |
394 | -describe BlobController, "routing" do | |
394 | +describe Projects::BlobController, "routing" do | |
395 | 395 | it "to #show" do |
396 | - get("/gitlabhq/blob/master/app/models/project.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') | |
397 | - get("/gitlabhq/blob/master/app/models/compare.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/compare.rb') | |
398 | - get("/gitlab/gitlabhq/blob/master/files.scss").should route_to('blob#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') | |
396 | + get("/gitlabhq/blob/master/app/models/project.rb").should route_to('projects/blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') | |
397 | + get("/gitlabhq/blob/master/app/models/compare.rb").should route_to('projects/blob#show', project_id: 'gitlabhq', id: 'master/app/models/compare.rb') | |
398 | + get("/gitlab/gitlabhq/blob/master/files.scss").should route_to('projects/blob#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') | |
399 | 399 | end |
400 | 400 | end |
401 | 401 | |
402 | 402 | # project_tree GET /:project_id/tree/:id(.:format) tree#show {id: /.+/, project_id: /[^\/]+/} |
403 | -describe TreeController, "routing" do | |
403 | +describe Projects::TreeController, "routing" do | |
404 | 404 | it "to #show" do |
405 | - get("/gitlabhq/tree/master/app/models/project.rb").should route_to('tree#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') | |
406 | - get("/gitlab/gitlabhq/tree/master/files.scss").should route_to('tree#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') | |
405 | + get("/gitlabhq/tree/master/app/models/project.rb").should route_to('projects/tree#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') | |
406 | + get("/gitlab/gitlabhq/tree/master/files.scss").should route_to('projects/tree#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') | |
407 | 407 | end |
408 | 408 | end |
409 | 409 | |
410 | 410 | # project_compare_index GET /:project_id/compare(.:format) compare#index {id: /[^\/]+/, project_id: /[^\/]+/} |
411 | 411 | # POST /:project_id/compare(.:format) compare#create {id: /[^\/]+/, project_id: /[^\/]+/} |
412 | 412 | # project_compare /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/} |
413 | -describe CompareController, "routing" do | |
413 | +describe Projects::CompareController, "routing" do | |
414 | 414 | it "to #index" do |
415 | - get("/gitlabhq/compare").should route_to('compare#index', project_id: 'gitlabhq') | |
415 | + get("/gitlabhq/compare").should route_to('projects/compare#index', project_id: 'gitlabhq') | |
416 | 416 | end |
417 | 417 | |
418 | 418 | it "to #compare" do |
419 | - post("/gitlabhq/compare").should route_to('compare#create', project_id: 'gitlabhq') | |
419 | + post("/gitlabhq/compare").should route_to('projects/compare#create', project_id: 'gitlabhq') | |
420 | 420 | end |
421 | 421 | |
422 | 422 | it "to #show" do |
423 | - get("/gitlabhq/compare/master...stable").should route_to('compare#show', project_id: 'gitlabhq', from: 'master', to: 'stable') | |
424 | - get("/gitlabhq/compare/issue/1234...stable").should route_to('compare#show', project_id: 'gitlabhq', from: 'issue/1234', to: 'stable') | |
423 | + get("/gitlabhq/compare/master...stable").should route_to('projects/compare#show', project_id: 'gitlabhq', from: 'master', to: 'stable') | |
424 | + get("/gitlabhq/compare/issue/1234...stable").should route_to('projects/compare#show', project_id: 'gitlabhq', from: 'issue/1234', to: 'stable') | |
425 | 425 | end |
426 | 426 | end |
427 | 427 | |
428 | -describe NetworkController, "routing" do | |
428 | +describe Projects::NetworkController, "routing" do | |
429 | 429 | it "to #show" do |
430 | - get("/gitlabhq/network/master").should route_to('network#show', project_id: 'gitlabhq', id: 'master') | |
431 | - get("/gitlabhq/network/master.json").should route_to('network#show', project_id: 'gitlabhq', id: 'master', format: "json") | |
430 | + get("/gitlabhq/network/master").should route_to('projects/network#show', project_id: 'gitlabhq', id: 'master') | |
431 | + get("/gitlabhq/network/master.json").should route_to('projects/network#show', project_id: 'gitlabhq', id: 'master', format: "json") | |
432 | 432 | end |
433 | 433 | end |
434 | 434 | |
435 | -describe GraphsController, "routing" do | |
435 | +describe Projects::GraphsController, "routing" do | |
436 | 436 | it "to #show" do |
437 | - get("/gitlabhq/graphs/master").should route_to('graphs#show', project_id: 'gitlabhq', id: 'master') | |
437 | + get("/gitlabhq/graphs/master").should route_to('projects/graphs#show', project_id: 'gitlabhq', id: 'master') | |
438 | 438 | end |
439 | 439 | end | ... | ... |