Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d85bbf0d
Commit
d85bbf0d
authored
Oct 12, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specs for new group routing
parent
9ac31d3b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
10 deletions
+32
-10
config/routes/group.rb
config/routes/group.rb
+1
-1
spec/requests/group_routing_spec.rb
spec/requests/group_routing_spec.rb
+11
-0
spec/routing/group_routing_spec.rb
spec/routing/group_routing_spec.rb
+17
-0
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+3
-9
No files found.
config/routes/group.rb
View file @
d85bbf0d
...
...
@@ -81,7 +81,7 @@ constraints(GroupUrlConstrainer.new) do
## EE-specific
get
:boards
,
to:
redirect
(
'/groups/%{group_id}/-/boards'
)
end
end
scope
(
path:
'*id'
,
as: :group
,
...
...
spec/requests/group_routing_spec.rb
0 → 100644
View file @
d85bbf0d
require
'spec_helper'
describe
'Deprecated boards paths'
do
it
'redirects to boards page'
do
group
=
create
:group
,
name:
'gitlabhq'
get
(
'/groups/gitlabhq/boards'
)
expect
(
response
).
to
redirect_to
(
group_boards_path
(
group
))
end
end
spec/routing/group_routing_spec.rb
0 → 100644
View file @
d85bbf0d
require
'spec_helper'
describe
'Group routing'
do
describe
'subgroup "boards"'
do
it
'shows group show page'
do
allow
(
Group
).
to
receive
(
:find_by_full_path
).
with
(
'gitlabhq/boards'
,
any_args
).
and_return
(
true
)
expect
(
get
(
'/groups/gitlabhq/boards'
)).
to
route_to
(
'groups#show'
,
id:
'gitlabhq/boards'
)
end
it
'shows boards index page'
do
allow
(
Group
).
to
receive
(
:find_by_full_path
).
with
(
'gitlabhq'
,
any_args
).
and_return
(
true
)
expect
(
get
(
'/groups/gitlabhq/-/boards'
)).
to
route_to
(
'groups/boards#index'
,
group_id:
'gitlabhq'
)
end
end
end
spec/routing/routing_spec.rb
View file @
d85bbf0d
...
...
@@ -285,17 +285,15 @@ end
describe
"Groups"
,
"routing"
do
let
(
:name
)
{
'complex.group-namegit'
}
before
do
allow_any_instance_of
(
GroupUrlConstrainer
).
to
receive
(
:matches?
).
and_return
(
true
)
end
let!
(
:group
)
{
create
(
:group
,
name:
name
)
}
it
"to #show"
do
expect
(
get
(
"/groups/
#{
name
}
"
)).
to
route_to
(
'groups#show'
,
id:
name
)
end
it
"also supports nested groups"
do
expect
(
get
(
"/
#{
name
}
/
#{
name
}
"
)).
to
route_to
(
'groups#show'
,
id:
"
#{
name
}
/
#{
name
}
"
)
nested_group
=
create
(
:group
,
parent:
group
)
expect
(
get
(
"/
#{
name
}
/
#{
nested_group
.
name
}
"
)).
to
route_to
(
'groups#show'
,
id:
"
#{
name
}
/
#{
nested_group
.
name
}
"
)
end
it
"also display group#show on the short path"
do
...
...
@@ -313,10 +311,6 @@ describe "Groups", "routing" do
it
"to #members"
do
expect
(
get
(
"/groups/
#{
name
}
/group_members"
)).
to
route_to
(
'groups/group_members#index'
,
group_id:
name
)
end
it
"also display group#show with slash in the path"
do
expect
(
get
(
'/group/subgroup'
)).
to
route_to
(
'groups#show'
,
id:
'group/subgroup'
)
end
end
describe
HealthCheckController
,
'routing'
do
...
...
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