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
9c6480db
Commit
9c6480db
authored
Dec 20, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move test for HTML stage endpoint to controller specs
parent
b2daf9f1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
33 deletions
+47
-33
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+46
-0
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+1
-1
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+0
-32
No files found.
spec/controllers/projects/pipelines_controller_spec.rb
0 → 100644
View file @
9c6480db
require
'spec_helper'
describe
Projects
::
PipelinesController
do
include
ApiHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
before
do
sign_in
(
user
)
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'
)
get_stage
(
'build'
)
end
it
'returns html source for stage dropdown'
do
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
'projects/pipelines/_stage'
)
expect
(
json_response
).
to
include
(
'html'
)
end
end
context
'when accessing unknown stage'
do
before
do
get_stage
(
'test'
)
end
it
{
expect
(
response
).
to
have_http_status
(
:not_found
)
}
end
end
end
spec/features/projects/pipelines/pipeline_spec.rb
View file @
9c6480db
require
'spec_helper'
describe
"Pipelines"
,
feature:
true
,
js:
true
do
describe
'Pipeline'
,
:feature
,
:js
do
include
GitlabRoutingHelper
let
(
:project
)
{
create
(
:empty_project
)
}
...
...
spec/features/projects/pipelines/pipelines_spec.rb
View file @
9c6480db
...
...
@@ -199,38 +199,6 @@ describe "Pipelines", feature: true, js:true do
end
end
describe
'GET /:project/pipelines/stage.json?name=stage'
do
let!
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
ref:
'master'
,
status:
'running'
)
end
context
'when accessing existing stage'
do
let!
(
:build
)
do
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
'build'
)
end
before
do
visit
stage_namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
,
format: :json
,
stage:
'build'
)
end
it
do
expect
(
page
).
to
have_http_status
(
:ok
)
expect
(
page
.
source
).
to
include
(
"html"
)
end
end
context
'when accessing unknown stage'
do
before
do
visit
stage_namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
,
format: :json
,
stage:
'test'
)
end
it
{
expect
(
page
).
to
have_http_status
(
:not_found
)
}
end
end
describe
'POST /:project/pipelines'
do
let
(
:project
)
{
create
(
:project
)
}
...
...
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