BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2d6d52ca
Commit
2d6d52ca
authored
Jan 17, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve pipeline specs by removing instance variables
parent
e7fdb1aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
20 deletions
+40
-20
pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+40
-20
No files found.
spec/features/projects/pipelines/pipeline_spec.rb
View file @
2d6d52ca
...
...
@@ -11,18 +11,41 @@ describe 'Pipeline', :feature, :js do
project
.
team
<<
[
user
,
:developer
]
end
shared_context
'pipeline builds'
do
let!
(
:build_passed
)
do
create
(
:ci_build
,
:success
,
pipeline:
pipeline
,
stage:
'build'
,
name:
'build'
)
end
let!
(
:build_failed
)
do
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
,
stage:
'test'
,
name:
'test'
,
commands:
'test'
)
end
let!
(
:build_running
)
do
create
(
:ci_build
,
:running
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'deploy'
)
end
let!
(
:build_manual
)
do
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'manual-build'
)
end
let!
(
:build_external
)
do
create
(
:generic_commit_status
,
status:
'success'
,
pipeline:
pipeline
,
name:
'jenkins'
,
stage:
'external'
)
end
end
describe
'GET /:project/pipelines/:id'
do
include_context
'pipeline builds'
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
'master'
,
sha:
project
.
commit
.
id
)
}
before
do
@success
=
create
(
:ci_build
,
:success
,
pipeline:
pipeline
,
stage:
'build'
,
name:
'build'
)
@failed
=
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
,
stage:
'test'
,
name:
'test'
,
commands:
'test'
)
@running
=
create
(
:ci_build
,
:running
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'deploy'
)
@manual
=
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'manual-build'
)
@external
=
create
(
:generic_commit_status
,
status:
'success'
,
pipeline:
pipeline
,
name:
'jenkins'
,
stage:
'external'
)
end
before
{
visit
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
}
it
'shows the pipeline graph'
do
...
...
@@ -157,26 +180,23 @@ describe 'Pipeline', :feature, :js do
end
describe
'GET /:project/pipelines/:id/builds'
do
include_context
'pipeline builds'
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
'master'
,
sha:
project
.
commit
.
id
)
}
before
do
@success
=
create
(
:ci_build
,
:success
,
pipeline:
pipeline
,
stage:
'build'
,
name:
'build'
)
@failed
=
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
,
stage:
'test'
,
name:
'test'
,
commands:
'test'
)
@running
=
create
(
:ci_build
,
:running
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'deploy'
)
@manual
=
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
stage:
'deploy'
,
name:
'manual-build'
)
@external
=
create
(
:generic_commit_status
,
status:
'success'
,
pipeline:
pipeline
,
name:
'jenkins'
,
stage:
'external'
)
visit
builds_namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
end
before
{
visit
builds_namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)}
it
'shows a list of builds'
do
expect
(
page
).
to
have_content
(
'Test'
)
expect
(
page
).
to
have_content
(
@success
.
id
)
expect
(
page
).
to
have_content
(
build_passed
.
id
)
expect
(
page
).
to
have_content
(
'Deploy'
)
expect
(
page
).
to
have_content
(
@
failed
.
id
)
expect
(
page
).
to
have_content
(
@
running
.
id
)
expect
(
page
).
to
have_content
(
@
external
.
id
)
expect
(
page
).
to
have_content
(
build_
failed
.
id
)
expect
(
page
).
to
have_content
(
build_
running
.
id
)
expect
(
page
).
to
have_content
(
build_
external
.
id
)
expect
(
page
).
to
have_content
(
'Retry failed'
)
expect
(
page
).
to
have_content
(
'Cancel running'
)
expect
(
page
).
to
have_link
(
'Play'
)
...
...
@@ -230,7 +250,7 @@ describe 'Pipeline', :feature, :js do
end
end
it
{
expect
(
@
manual
.
reload
).
to
be_pending
}
it
{
expect
(
build_
manual
.
reload
).
to
be_pending
}
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