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
58adbd12
Commit
58adbd12
authored
Apr 09, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE specific parts of the spec
parent
e0934f66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
35 deletions
+55
-35
ee/spec/serializers/pipeline_details_entity_spec.rb
ee/spec/serializers/pipeline_details_entity_spec.rb
+55
-0
spec/serializers/pipeline_details_entity_spec.rb
spec/serializers/pipeline_details_entity_spec.rb
+0
-35
No files found.
ee/spec/serializers/pipeline_details_entity_spec.rb
0 → 100644
View file @
58adbd12
require
'spec_helper'
describe
PipelineDetailsEntity
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:request
)
{
double
(
'request'
)
}
before
do
stub_not_protect_default_branch
allow
(
request
).
to
receive
(
:current_user
).
and_return
(
user
)
end
let
(
:entity
)
do
described_class
.
represent
(
pipeline
,
request:
request
)
end
describe
'#as_json'
do
subject
{
entity
.
as_json
}
context
'when pipeline is triggered by other pipeline'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
before
do
create
(
:ci_sources_pipeline
,
pipeline:
pipeline
)
end
it
'contains an information about depedent pipeline'
do
expect
(
subject
[
:triggered_by
]).
to
be_a
(
Hash
)
expect
(
subject
[
:triggered_by
][
:path
]).
not_to
be_nil
expect
(
subject
[
:triggered_by
][
:details
]).
not_to
be_nil
expect
(
subject
[
:triggered_by
][
:details
][
:status
]).
not_to
be_nil
expect
(
subject
[
:triggered_by
][
:project
]).
not_to
be_nil
end
end
context
'when pipeline triggered other pipeline'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
before
do
create
(
:ci_sources_pipeline
,
source_job:
build
)
create
(
:ci_sources_pipeline
,
source_job:
build
)
end
it
'contains an information about depedent pipeline'
do
expect
(
subject
[
:triggered
]).
to
be_a
(
Array
)
expect
(
subject
[
:triggered
].
length
).
to
eq
(
2
)
expect
(
subject
[
:triggered
].
first
[
:path
]).
not_to
be_nil
expect
(
subject
[
:triggered
].
first
[
:details
]).
not_to
be_nil
expect
(
subject
[
:triggered
].
first
[
:details
][
:status
]).
not_to
be_nil
expect
(
subject
[
:triggered
].
first
[
:project
]).
not_to
be_nil
end
end
end
end
spec/serializers/pipeline_details_entity_spec.rb
View file @
58adbd12
...
...
@@ -136,40 +136,5 @@ describe PipelineDetailsEntity do
expect
(
subject
[
:flags
][
:yaml_errors
]).
to
be
false
end
end
context
'when pipeline is triggered by other pipeline'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
before
do
create
(
:ci_sources_pipeline
,
pipeline:
pipeline
)
end
it
'contains an information about depedent pipeline'
do
expect
(
subject
[
:triggered_by
]).
to
be_a
(
Hash
)
expect
(
subject
[
:triggered_by
][
:path
]).
not_to
be_nil
expect
(
subject
[
:triggered_by
][
:details
]).
not_to
be_nil
expect
(
subject
[
:triggered_by
][
:details
][
:status
]).
not_to
be_nil
expect
(
subject
[
:triggered_by
][
:project
]).
not_to
be_nil
end
end
context
'when pipeline triggered other pipeline'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
)
}
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
before
do
create
(
:ci_sources_pipeline
,
source_job:
build
)
create
(
:ci_sources_pipeline
,
source_job:
build
)
end
it
'contains an information about depedent pipeline'
do
expect
(
subject
[
:triggered
]).
to
be_a
(
Array
)
expect
(
subject
[
:triggered
].
length
).
to
eq
(
2
)
expect
(
subject
[
:triggered
].
first
[
:path
]).
not_to
be_nil
expect
(
subject
[
:triggered
].
first
[
:details
]).
not_to
be_nil
expect
(
subject
[
:triggered
].
first
[
:details
][
:status
]).
not_to
be_nil
expect
(
subject
[
:triggered
].
first
[
:project
]).
not_to
be_nil
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