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
9684084f
Commit
9684084f
authored
Apr 15, 2020
by
drew cimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use subject in Ci::Processable#needs_attributes specs
parent
a615b544
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
spec/models/ci/processable_spec.rb
spec/models/ci/processable_spec.rb
+20
-18
No files found.
spec/models/ci/processable_spec.rb
View file @
9684084f
...
...
@@ -52,31 +52,33 @@ describe Ci::Processable do
end
describe
'validate presence of scheduling_type'
do
context
'on create'
do
using
RSpec
::
Parameterized
::
TableSyntax
using
RSpec
::
Parameterized
::
TableSyntax
subject
{
build
(
:ci_build
,
project:
project
,
pipeline:
pipeline
,
importing:
importing
)
}
subject
{
build
(
:ci_build
,
project:
project
,
pipeline:
pipeline
,
importing:
importing
)
}
where
(
:importing
,
:validate_scheduling_type_flag
,
:should_validate
)
do
false
|
true
|
true
false
|
false
|
false
true
|
true
|
false
true
|
false
|
false
end
where
(
:importing
,
:validate_scheduling_type_flag
,
:should_validate
)
do
false
|
true
|
true
false
|
false
|
false
true
|
true
|
false
true
|
false
|
false
end
with_them
do
before
do
stub_feature_flags
(
validate_scheduling_type_of_processables:
validate_scheduling_type_flag
)
end
with_them
do
before
do
stub_feature_flags
(
validate_scheduling_type_of_processables:
validate_scheduling_type_flag
)
end
it
'validates on create'
do
context
'on create'
do
it
'validates presence'
do
if
should_validate
is_expected
.
to
validate_presence_of
(
:scheduling_type
).
on
(
:create
)
else
is_expected
.
not_to
validate_presence_of
(
:scheduling_type
).
on
(
:create
)
end
end
end
context
'on update'
do
it
{
is_expected
.
not_to
validate_presence_of
(
:scheduling_type
).
on
(
:update
)
}
end
end
...
...
@@ -110,6 +112,8 @@ describe Ci::Processable do
describe
'#needs_attributes'
do
let
(
:build
)
{
create
(
:ci_build
,
:created
,
project:
project
,
pipeline:
pipeline
)
}
subject
{
build
.
needs_attributes
}
context
'with needs'
do
before
do
create
(
:ci_build_need
,
build:
build
,
name:
'test1'
)
...
...
@@ -117,7 +121,7 @@ describe Ci::Processable do
end
it
'returns all needs attributes'
do
expect
(
build
.
needs_attributes
)
.
to
contain_exactly
(
is_expected
.
to
contain_exactly
(
{
'artifacts'
=>
true
,
'name'
=>
'test1'
},
{
'artifacts'
=>
true
,
'name'
=>
'test2'
}
)
...
...
@@ -125,9 +129,7 @@ describe Ci::Processable do
end
context
'without needs'
do
it
'returns all needs attributes'
do
expect
(
build
.
needs_attributes
).
to
be_empty
end
it
{
is_expected
.
to
be_empty
}
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