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
30a6fb64
Commit
30a6fb64
authored
6 years ago
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix atomic internal id spec to allow generate pipeline
parent
40e17727
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
spec/support/shared_examples/models/atomic_internal_id_spec.rb
...support/shared_examples/models/atomic_internal_id_spec.rb
+7
-12
No files found.
spec/support/shared_examples/models/atomic_internal_id_spec.rb
View file @
30a6fb64
require
'spec_helper'
require
'spec_helper'
shared_examples_for
'AtomicInternalId'
do
shared_examples_for
'AtomicInternalId'
do
let
(
:validate_presence
)
{
true
}
let
(
:validate_presence
)
{
true
}
describe
'.has_internal_id'
do
describe
'.has_internal_id'
do
...
@@ -11,21 +11,16 @@ shared_examples_for 'AtomicInternalId' do
...
@@ -11,21 +11,16 @@ shared_examples_for 'AtomicInternalId' do
end
end
describe
'Validation'
do
describe
'Validation'
do
subject
{
instance
}
before
do
before
do
allow
(
InternalId
).
to
receive
(
:generate_next
).
and_return
(
nil
)
allow
_any_instance_of
(
described_class
).
to
receive
(
:ensure_iid!
)
{}
end
end
it
'checks presence'
do
it
'validates presence'
do
if
validate_presence
instance
.
valid?
is_expected
.
to
validate_presence_of
(
internal_id_attribute
)
else
is_expected
.
not_to
validate_presence_of
(
internal_id_attribute
)
end
end
it
{
is_expected
.
to
validate_numericality_of
(
internal_id_attribute
)
}
expect
(
instance
.
errors
[
:iid
]).
to
include
(
"can't be blank"
)
if
validate_presence
expect
(
instance
.
errors
[
:iid
]).
to
include
(
"is not a number"
)
# numericality
end
end
end
describe
'Creating an instance'
do
describe
'Creating an instance'
do
...
...
This diff is collapsed.
Click to expand it.
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