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
70c0a76c
Commit
70c0a76c
authored
Dec 15, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rubocop offenses in code related to pipelines
parent
01c8499a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
20 deletions
+24
-20
pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+21
-14
pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+3
-6
No files found.
app/controllers/projects/pipelines_controller.rb
View file @
70c0a76c
...
...
@@ -7,25 +7,32 @@ class Projects::PipelinesController < Projects::ApplicationController
def
index
@scope
=
params
[
:scope
]
@pipelines
=
PipelinesFinder
.
new
(
project
).
execute
(
scope:
@scope
).
page
(
params
[
:page
]).
per
(
30
)
@pipelines
=
PipelinesFinder
.
new
(
project
)
.
execute
(
scope:
@scope
)
.
page
(
params
[
:page
])
.
per
(
30
)
@running_or_pending_count
=
PipelinesFinder
.
new
(
project
).
execute
(
scope:
'running'
).
count
@pipelines_count
=
PipelinesFinder
.
new
(
project
).
execute
.
count
@running_or_pending_count
=
PipelinesFinder
.
new
(
project
).
execute
(
scope:
'running'
).
count
@pipelines_count
=
PipelinesFinder
.
new
(
project
).
execute
.
count
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
{
pipelines:
PipelineSerializer
.
new
(
project:
@project
,
user:
@current_user
)
.
with_pagination
(
request
,
response
)
.
represent
(
@pipelines
),
updated_at:
Time
.
now
.
utc
,
count:
{
all:
@pipelines_count
,
running_or_pending:
@running_or_pending_count
}
}
render
json:
{
pipelines:
PipelineSerializer
.
new
(
project:
@project
,
user:
@current_user
)
.
with_pagination
(
request
,
response
)
.
represent
(
@pipelines
),
updated_at:
Time
.
now
.
utc
,
count:
{
all:
@pipelines_count
,
running_or_pending:
@running_or_pending_count
}
}
end
end
end
...
...
spec/features/projects/pipelines/pipelines_spec.rb
View file @
70c0a76c
...
...
@@ -271,12 +271,9 @@ describe "Pipelines", feature: true, js: true do
context
'with gitlab-ci.yml'
do
before
{
stub_ci_pipeline_to_return_yaml_file
}
it
do
expect
{
click_on
'Create pipeline'
}.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
1
)
it
'creates a new pipeline'
do
expect
{
click_on
'Create pipeline'
}
.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
1
)
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