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
4721cfe8
Commit
4721cfe8
authored
Feb 14, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE-specific code from spec/factories/namespaces.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
faa2fb53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
29 deletions
+33
-29
ee/spec/factories/namespaces.rb
ee/spec/factories/namespaces.rb
+33
-0
spec/factories/namespaces.rb
spec/factories/namespaces.rb
+0
-29
No files found.
ee/spec/factories/namespaces.rb
0 → 100644
View file @
4721cfe8
# frozen_string_literal: true
FactoryBot
.
modify
do
factory
:namespace
do
transient
do
plan
nil
end
before
(
:create
)
do
|
namespace
,
evaluator
|
if
evaluator
.
plan
.
present?
namespace
.
plan
=
create
(
evaluator
.
plan
)
end
end
trait
:with_build_minutes
do
namespace_statistics
factory: :namespace_statistics
,
shared_runners_seconds:
400
.
minutes
.
to_i
end
trait
:with_build_minutes_limit
do
shared_runners_minutes_limit
500
end
trait
:with_not_used_build_minutes_limit
do
namespace_statistics
factory: :namespace_statistics
,
shared_runners_seconds:
300
.
minutes
.
to_i
shared_runners_minutes_limit
500
end
trait
:with_used_build_minutes_limit
do
namespace_statistics
factory: :namespace_statistics
,
shared_runners_seconds:
1000
.
minutes
.
to_i
shared_runners_minutes_limit
500
end
end
end
spec/factories/namespaces.rb
View file @
4721cfe8
...
...
@@ -19,34 +19,5 @@ FactoryBot.define do
owner
.
namespace
=
namespace
end
end
trait
:with_build_minutes
do
namespace_statistics
factory: :namespace_statistics
,
shared_runners_seconds:
400
.
minutes
.
to_i
end
trait
:with_build_minutes_limit
do
shared_runners_minutes_limit
500
end
trait
:with_not_used_build_minutes_limit
do
namespace_statistics
factory: :namespace_statistics
,
shared_runners_seconds:
300
.
minutes
.
to_i
shared_runners_minutes_limit
500
end
trait
:with_used_build_minutes_limit
do
namespace_statistics
factory: :namespace_statistics
,
shared_runners_seconds:
1000
.
minutes
.
to_i
shared_runners_minutes_limit
500
end
# EE-only
transient
do
plan
nil
end
before
:create
do
|
namespace
,
evaluator
|
if
evaluator
.
plan
.
present?
namespace
.
plan
=
create
(
evaluator
.
plan
)
end
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