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
Tatuya Kamada
gitlab-ce
Commits
66bca235
Commit
66bca235
authored
Feb 23, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds missing tests for all status accepted in scope
parent
05c66406
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
16 deletions
+28
-16
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+9
-6
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+19
-10
No files found.
spec/controllers/projects/pipelines_controller_spec.rb
View file @
66bca235
...
@@ -12,7 +12,10 @@ describe Projects::PipelinesController do
...
@@ -12,7 +12,10 @@ describe Projects::PipelinesController do
describe
'GET index.json'
do
describe
'GET index.json'
do
before
do
before
do
create_list
(
:ci_empty_pipeline
,
2
,
project:
project
)
create
(
:ci_empty_pipeline
,
status:
'pending'
,
project:
project
)
create
(
:ci_empty_pipeline
,
status:
'running'
,
project:
project
)
create
(
:ci_empty_pipeline
,
status:
'created'
,
project:
project
)
create
(
:ci_empty_pipeline
,
status:
'success'
,
project:
project
)
get
:index
,
namespace_id:
project
.
namespace
.
path
,
get
:index
,
namespace_id:
project
.
namespace
.
path
,
project_id:
project
.
path
,
project_id:
project
.
path
,
...
@@ -23,11 +26,11 @@ describe Projects::PipelinesController do
...
@@ -23,11 +26,11 @@ describe Projects::PipelinesController do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
json_response
).
to
include
(
'pipelines'
)
expect
(
json_response
).
to
include
(
'pipelines'
)
expect
(
json_response
[
'pipelines'
].
count
).
to
eq
2
expect
(
json_response
[
'pipelines'
].
count
).
to
eq
4
expect
(
json_response
[
'count'
][
'all'
]).
to
eq
2
expect
(
json_response
[
'count'
][
'all'
]).
to
eq
4
expect
(
json_response
[
'count'
][
'running'
]).
to
eq
0
expect
(
json_response
[
'count'
][
'running'
]).
to
eq
1
expect
(
json_response
[
'count'
][
'pending'
]).
to
eq
2
expect
(
json_response
[
'count'
][
'pending'
]).
to
eq
1
expect
(
json_response
[
'count'
][
'finished'
]).
to
eq
0
expect
(
json_response
[
'count'
][
'finished'
]).
to
eq
1
end
end
end
end
...
...
spec/features/projects/pipelines/pipelines_spec.rb
View file @
66bca235
...
@@ -26,18 +26,27 @@ describe 'Pipelines', :feature, :js do
...
@@ -26,18 +26,27 @@ describe 'Pipelines', :feature, :js do
)
)
end
end
[
:all
,
:running
,
:branches
].
each
do
|
scope
|
context
'scope'
do
context
"when displaying
#{
scope
}
"
do
before
do
before
do
create
(
:ci_empty_pipeline
,
status:
'pending'
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
'master'
)
visit_project_pipelines
(
scope:
scope
)
create
(
:ci_empty_pipeline
,
status:
'running'
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
'master'
)
end
create
(
:ci_empty_pipeline
,
status:
'created'
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
'master'
)
create
(
:ci_empty_pipeline
,
status:
'success'
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
'master'
)
end
it
'contains pipeline commit short SHA'
do
[
:all
,
:running
,
:pending
,
:finished
,
:branches
].
each
do
|
scope
|
expect
(
page
).
to
have_content
(
pipeline
.
short_sha
)
context
"when displaying
#{
scope
}
"
do
end
before
do
visit_project_pipelines
(
scope:
scope
)
end
it
'contains pipeline commit short SHA'
do
expect
(
page
).
to
have_content
(
pipeline
.
short_sha
)
end
it
'contains branch name'
do
it
'contains branch name'
do
expect
(
page
).
to
have_content
(
pipeline
.
ref
)
expect
(
page
).
to
have_content
(
pipeline
.
ref
)
end
end
end
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