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
fb77d8e6
Commit
fb77d8e6
authored
Jul 31, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use skip_create so that create would act like build
parent
311fe2ad
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
+6
-4
spec/factories/geo/event_log_state.rb
spec/factories/geo/event_log_state.rb
+2
-0
spec/factories/geo/project_registry.rb
spec/factories/geo/project_registry.rb
+2
-0
spec/factories/licenses.rb
spec/factories/licenses.rb
+2
-0
spec/factories_spec.rb
spec/factories_spec.rb
+0
-4
No files found.
spec/factories/geo/event_log_state.rb
View file @
fb77d8e6
FactoryGirl
.
define
do
factory
:geo_event_log_state
,
class:
Geo
::
EventLogState
do
skip_create
sequence
(
:event_id
)
end
end
spec/factories/geo/project_registry.rb
View file @
fb77d8e6
FactoryGirl
.
define
do
factory
:geo_project_registry
,
class:
Geo
::
ProjectRegistry
do
skip_create
project
factory: :empty_project
last_repository_synced_at
nil
last_repository_successful_sync_at
nil
...
...
spec/factories/licenses.rb
View file @
fb77d8e6
FactoryGirl
.
define
do
factory
:gitlab_license
,
class:
"Gitlab::License"
do
skip_create
starts_at
{
Date
.
today
-
1
.
month
}
expires_at
{
Date
.
today
+
11
.
months
}
notify_users_at
{
|
l
|
l
.
expires_at
}
...
...
spec/factories_spec.rb
View file @
fb77d8e6
...
...
@@ -8,16 +8,12 @@ describe 'factories' do
end
it
'does not raise error when created'
do
skip
(
"
#{
factory
.
name
}
cannot be saved"
)
unless
build
(
factory
.
name
).
respond_to?
(
:save!
)
expect
{
create
(
factory
.
name
)
}.
not_to
raise_error
end
factory
.
definition
.
defined_traits
.
map
(
&
:name
).
each
do
|
trait_name
|
describe
"linting
#{
trait_name
}
trait"
do
skip
'does not raise error when created'
do
skip
(
"
#{
factory
.
name
}
cannot be saved"
)
unless
build
(
factory
.
name
).
respond_to?
(
:save!
)
expect
{
create
(
factory
.
name
,
trait_name
)
}.
not_to
raise_error
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