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
5ee6d0fb
Commit
5ee6d0fb
authored
Oct 14, 2020
by
Corinna Wiesner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add namespace of type group to all_projects specs
parent
26432962
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
spec/models/namespace_spec.rb
spec/models/namespace_spec.rb
+18
-6
No files found.
spec/models/namespace_spec.rb
View file @
5ee6d0fb
...
...
@@ -855,13 +855,13 @@ RSpec.describe Namespace do
end
describe
'#all_projects'
do
shared_examples
'all projects for a namespace'
do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:child
)
{
create
(
:group
,
parent:
group
)
}
let_it_be
(
:project1
)
{
create
(
:project_empty_repo
,
namespace:
group
)
}
let_it_be
(
:project2
)
{
create
(
:project_empty_repo
,
namespace:
child
)
}
let
(
:namespace
)
{
create
(
:namespace
)
}
let
(
:child
)
{
create
(
:group
,
parent:
namespace
)
}
let!
(
:project1
)
{
create
(
:project_empty_repo
,
namespace:
namespace
)
}
let!
(
:project2
)
{
create
(
:project_empty_repo
,
namespace:
child
)
}
it
{
expect
(
group
.
all_projects
.
to_a
).
to
match_array
([
project2
,
project1
])
}
shared_examples
'all projects for a namespace'
do
it
{
expect
(
namespace
.
all_projects
.
to_a
).
to
match_array
([
project2
,
project1
])
}
it
{
expect
(
child
.
all_projects
.
to_a
).
to
match_array
([
project2
])
}
end
...
...
@@ -871,6 +871,12 @@ RSpec.describe Namespace do
end
include_examples
'all projects for a namespace'
context
'when namespace is a group'
do
let
(
:namespace
)
{
create
(
:group
)
}
include_examples
'all projects for a namespace'
end
end
context
'with route path wildcard approach'
do
...
...
@@ -879,6 +885,12 @@ RSpec.describe Namespace do
end
include_examples
'all projects for a namespace'
context
'when namespace is a group'
do
let_it_be
(
:namespace
)
{
create
(
:group
)
}
include_examples
'all projects for a namespace'
end
end
end
...
...
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