BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f4efb190
Commit
f4efb190
authored
Oct 06, 2014
by
Ciro Santilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for tree edit routes
Critical because of possible confusion between /:id/preview and /:id for a path that ends in preview.
parent
70004f4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
routes.rb
config/routes.rb
+1
-0
project_routing_spec.rb
spec/routing/project_routing_spec.rb
+20
-0
No files found.
config/routes.rb
View file @
f4efb190
...
@@ -198,6 +198,7 @@ Gitlab::Application.routes.draw do
...
@@ -198,6 +198,7 @@ Gitlab::Application.routes.draw do
resources
:raw
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
resources
:raw
,
only:
[
:show
],
constraints:
{
id:
/.+/
}
resources
:tree
,
only:
[
:show
],
constraints:
{
id:
/.+/
,
format:
/(html|js)/
}
resources
:tree
,
only:
[
:show
],
constraints:
{
id:
/.+/
,
format:
/(html|js)/
}
resources
:edit_tree
,
only:
[
:show
,
:update
],
constraints:
{
id:
/.+/
},
path:
'edit'
do
resources
:edit_tree
,
only:
[
:show
,
:update
],
constraints:
{
id:
/.+/
},
path:
'edit'
do
# Cannot be GET to differentiate from GET paths that end in preview.
post
:preview
,
on: :member
post
:preview
,
on: :member
end
end
resources
:new_tree
,
only:
[
:show
,
:update
],
constraints:
{
id:
/.+/
},
path:
'new'
resources
:new_tree
,
only:
[
:show
,
:update
],
constraints:
{
id:
/.+/
},
path:
'new'
...
...
spec/routing/project_routing_spec.rb
View file @
f4efb190
...
@@ -432,6 +432,26 @@ describe Projects::TreeController, "routing" do
...
@@ -432,6 +432,26 @@ describe Projects::TreeController, "routing" do
end
end
end
end
describe
Projects
::
EditTreeController
,
'routing'
do
it
'to #show'
do
get
(
'/gitlab/gitlabhq/edit/master/app/models/project.rb'
).
should
(
route_to
(
'projects/edit_tree#show'
,
project_id:
'gitlab/gitlabhq'
,
id:
'master/app/models/project.rb'
))
get
(
'/gitlab/gitlabhq/edit/master/app/models/project.rb/preview'
).
should
(
route_to
(
'projects/edit_tree#show'
,
project_id:
'gitlab/gitlabhq'
,
id:
'master/app/models/project.rb/preview'
))
end
it
'to #preview'
do
post
(
'/gitlab/gitlabhq/edit/master/app/models/project.rb/preview'
).
should
(
route_to
(
'projects/edit_tree#preview'
,
project_id:
'gitlab/gitlabhq'
,
id:
'master/app/models/project.rb'
))
end
end
# project_compare_index GET /:project_id/compare(.:format) compare#index {id: /[^\/]+/, project_id: /[^\/]+/}
# project_compare_index GET /:project_id/compare(.:format) compare#index {id: /[^\/]+/, project_id: /[^\/]+/}
# POST /:project_id/compare(.:format) compare#create {id: /[^\/]+/, project_id: /[^\/]+/}
# POST /:project_id/compare(.:format) compare#create {id: /[^\/]+/, project_id: /[^\/]+/}
# project_compare /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/}
# project_compare /:project_id/compare/:from...:to(.:format) compare#show {from: /.+/, to: /.+/, id: /[^\/]+/, project_id: /[^\/]+/}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment