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
5ec1c140
Commit
5ec1c140
authored
Dec 20, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve specs
parent
2b0b53cd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+5
-2
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+9
-5
spec/models/ci/stage_spec.rb
spec/models/ci/stage_spec.rb
+4
-2
No files found.
spec/features/projects/pipelines/pipelines_spec.rb
View file @
5ec1c140
...
...
@@ -152,7 +152,7 @@ describe "Pipelines" do
end
end
describe
'GET /:project/pipelines/stage?name=stage'
do
describe
'GET /:project/pipelines/stage
.json
?name=stage'
do
let!
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
ref:
'master'
,
status:
'running'
)
...
...
@@ -168,7 +168,10 @@ describe "Pipelines" do
project
.
namespace
,
project
,
pipeline
,
format: :json
,
stage:
'build'
)
end
it
{
expect
(
page
).
to
have_http_status
(
:ok
)
}
it
do
expect
(
page
).
to
have_http_status
(
:ok
)
expect
(
JSON
.
parse
(
page
.
source
)).
to
include
(
"html"
)
end
end
context
'when accessing unknown stage'
do
...
...
spec/models/ci/pipeline_spec.rb
View file @
5ec1c140
...
...
@@ -179,15 +179,19 @@ describe Ci::Pipeline, models: true do
subject
{
pipeline
.
stage
(
'test'
)
}
context
'with status in stage'
do
let!
(
:status
)
{
create
(
:commit_status
,
pipeline:
pipeline
,
stage:
'test'
)
}
it
'return stage object'
do
is_expected
.
to
be_a
(
Ci
::
Stage
)
before
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
}
end
context
'without status in stage'
do
let!
(
:status
)
{
create
(
:commit_status
,
pipeline:
pipeline
,
stage:
'build'
)
}
before
do
create
(
:commit_status
,
pipeline:
pipeline
,
stage:
'build'
)
end
it
'return stage object'
do
is_expected
.
to
be_nil
...
...
spec/models/ci/stage_spec.rb
View file @
5ec1c140
...
...
@@ -29,8 +29,10 @@ describe Ci::Stage, models: true do
end
describe
'#statuses_count'
do
let!
(
:stage_build
)
{
create_job
(
:ci_build
)
}
let!
(
:other_build
)
{
create_job
(
:ci_build
,
stage:
'other stage'
)
}
before
do
create_job
(
:ci_build
)
}
create_job
(
:ci_build
,
stage:
'other stage'
)
end
subject
{
stage
.
statuses_count
}
...
...
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