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
Léo-Paul Géneau
gitlab-ce
Commits
2b486c2b
Commit
2b486c2b
authored
Dec 20, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stage and pipeline specs and rubocop offenses
parent
ec4b1bc7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
21 deletions
+31
-21
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+10
-9
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+17
-8
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+3
-3
spec/models/ci/stage_spec.rb
spec/models/ci/stage_spec.rb
+1
-1
No files found.
spec/controllers/projects/pipelines_controller_spec.rb
View file @
2b486c2b
...
...
@@ -12,14 +12,6 @@ describe Projects::PipelinesController do
end
describe
'GET stages.json'
do
def
get_stage
(
name
)
get
:stage
,
namespace_id:
project
.
namespace
.
path
,
project_id:
project
.
path
,
id:
pipeline
.
id
,
stage:
name
,
format: :json
end
context
'when accessing existing stage'
do
before
do
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
'build'
)
...
...
@@ -39,8 +31,17 @@ describe Projects::PipelinesController do
get_stage
(
'test'
)
end
it
{
expect
(
response
).
to
have_http_status
(
:not_found
)
}
it
'responds with not found'
do
expect
(
response
).
to
have_http_status
(
:not_found
)
end
end
def
get_stage
(
name
)
get
:stage
,
namespace_id:
project
.
namespace
.
path
,
project_id:
project
.
path
,
id:
pipeline
.
id
,
stage:
name
,
format: :json
end
end
end
spec/features/projects/pipelines/pipelines_spec.rb
View file @
2b486c2b
require
'spec_helper'
describe
"Pipelines"
,
feature:
true
,
js
:true
do
describe
'Pipelines'
,
:feature
,
:js
do
include
GitlabRoutingHelper
include
WaitForAjax
...
...
@@ -70,23 +70,32 @@ describe "Pipelines", feature: true, js:true do
end
context
'with manual actions'
do
let!
(
:manual
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'manual build'
,
stage:
'test'
,
commands:
'test'
)
}
let!
(
:manual
)
do
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'manual build'
,
stage:
'test'
,
commands:
'test'
)
end
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
before
do
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
end
it
do
it
'has link to the manual action'
do
find
(
'.js-pipeline-dropdown-manual-actions'
).
click
expect
(
page
).
to
have_link
(
'Manual build'
)
end
context
'when playing'
do
expect
(
page
).
to
have_link
(
'Manual build'
)
end
context
'when manual action was played'
do
before
do
find
(
'.js-pipeline-dropdown-manual-actions'
).
click
click_link
(
'Manual build'
)
end
it
{
expect
(
manual
.
reload
).
to
be_pending
}
it
'enqueues manual action job'
do
expect
(
manual
.
reload
).
to
be_pending
end
end
end
...
...
spec/models/ci/pipeline_spec.rb
View file @
2b486c2b
...
...
@@ -183,9 +183,9 @@ describe Ci::Pipeline, models: true do
create
(
:commit_status
,
pipeline:
pipeline
,
stage:
'test'
)
end
it
{
expect
(
subject
).
to
be_a
(
Ci
::
Stage
)
}
it
{
expect
(
subject
.
name
).
to
eq
(
'stage'
)
}
it
{
expect
(
subject
.
statues
).
not_to
be_empty
}
it
{
expect
(
subject
).
to
be_a
Ci
::
Stage
}
it
{
expect
(
subject
.
name
).
to
eq
'test'
}
it
{
expect
(
subject
.
statu
s
es
).
not_to
be_empty
}
end
context
'without status in stage'
do
...
...
spec/models/ci/stage_spec.rb
View file @
2b486c2b
...
...
@@ -30,7 +30,7 @@ describe Ci::Stage, models: true do
describe
'#statuses_count'
do
before
do
create_job
(
:ci_build
)
}
create_job
(
:ci_build
)
create_job
(
:ci_build
,
stage:
'other stage'
)
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