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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
d7010fdc
Commit
d7010fdc
authored
Dec 07, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create nested group factory
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
b552a4eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
spec/factories/groups.rb
spec/factories/groups.rb
+4
-0
spec/models/group_spec.rb
spec/models/group_spec.rb
+7
-0
No files found.
spec/factories/groups.rb
View file @
d7010fdc
...
@@ -19,5 +19,9 @@ FactoryGirl.define do
...
@@ -19,5 +19,9 @@ FactoryGirl.define do
trait
:access_requestable
do
trait
:access_requestable
do
request_access_enabled
true
request_access_enabled
true
end
end
trait
:nested
do
parent
factory: :group
end
end
end
end
end
spec/models/group_spec.rb
View file @
d7010fdc
...
@@ -271,4 +271,11 @@ describe Group, models: true do
...
@@ -271,4 +271,11 @@ describe Group, models: true do
expect
(
group
.
web_url
).
to
include
(
"groups/
#{
group
.
name
}
"
)
expect
(
group
.
web_url
).
to
include
(
"groups/
#{
group
.
name
}
"
)
end
end
end
end
describe
'nested group'
do
subject
{
create
(
:group
,
:nested
)
}
it
{
is_expected
.
to
be_valid
}
it
{
expect
(
subject
.
parent
).
to
be_kind_of
(
Group
)
}
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