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
bf790c26
Commit
bf790c26
authored
May 03, 2018
by
Dylan Griffith
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use factory in specs for ProjectCiCdSettings
parent
7bc24ec2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
spec/factories/project_ci_cd_settings.rb
spec/factories/project_ci_cd_settings.rb
+10
-0
spec/factories/projects.rb
spec/factories/projects.rb
+1
-7
No files found.
spec/factories/project_ci_cd_settings.rb
0 → 100644
View file @
bf790c26
FactoryBot
.
define
do
factory
:project_ci_cd_setting
do
project
initialize_with
do
# ci_cd_settings are automatically created when a project is created
project
&
.
ci_cd_settings
||
new
end
end
end
spec/factories/projects.rb
View file @
bf790c26
...
...
@@ -14,6 +14,7 @@ FactoryBot.define do
# Associations
namespace
creator
{
group
?
create
(
:user
)
:
namespace
&
.
owner
}
ci_cd_settings
strategy: :build
,
factory: :project_ci_cd_setting
,
project:
nil
transient
do
# Nest Project Feature attributes
...
...
@@ -23,10 +24,6 @@ FactoryBot.define do
issues_access_level
ProjectFeature
::
ENABLED
merge_requests_access_level
ProjectFeature
::
ENABLED
repository_access_level
ProjectFeature
::
ENABLED
# we can't assign the delegated `#ci_cd_settings` attributes directly, as the
# `#ci_cd_settings` relation needs to be created first
group_runners_enabled
nil
end
after
(
:create
)
do
|
project
,
evaluator
|
...
...
@@ -51,9 +48,6 @@ FactoryBot.define do
end
project
.
group
&
.
refresh_members_authorized_projects
# assign the delegated `#ci_cd_settings` attributes after create
project
.
reload
.
group_runners_enabled
=
evaluator
.
group_runners_enabled
unless
evaluator
.
group_runners_enabled
.
nil?
end
trait
:public
do
...
...
Alain Takoudjou
@alain.takoudjou
mentioned in commit
794ac6c5
·
Aug 21, 2018
mentioned in commit
794ac6c5
mentioned in commit 794ac6c5421e04056dfd336559786fb166c9fa0a
Toggle commit list
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