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
ac115a9e
Commit
ac115a9e
authored
Dec 14, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some missing tests for detailed status methods
parent
309580bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
spec/models/build_spec.rb
spec/models/build_spec.rb
+9
-0
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+9
-0
spec/models/generic_commit_status_spec.rb
spec/models/generic_commit_status_spec.rb
+14
-2
No files found.
spec/models/build_spec.rb
View file @
ac115a9e
...
...
@@ -1246,4 +1246,13 @@ describe Ci::Build, models: true do
it
{
is_expected
.
to
eq
(
'review/master'
)
}
end
end
describe
'#detailed_status'
do
let
(
:user
)
{
create
(
:user
)
}
it
'returns a detailed status'
do
expect
(
build
.
detailed_status
(
user
))
.
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Cancelable
end
end
end
spec/models/commit_status_spec.rb
View file @
ac115a9e
...
...
@@ -234,4 +234,13 @@ describe CommitStatus, models: true do
end
end
end
describe
'#detailed_status'
do
let
(
:user
)
{
create
(
:user
)
}
it
'returns a detailed status'
do
expect
(
commit_status
.
detailed_status
(
user
))
.
to
be_a
Gitlab
::
Ci
::
Status
::
Success
end
end
end
spec/models/generic_commit_status_spec.rb
View file @
ac115a9e
require
'spec_helper'
describe
GenericCommitStatus
,
models:
true
do
let
(
:pipeline
)
{
FactoryGirl
.
create
:ci_pipeline
}
let
(
:generic_commit_status
)
{
FactoryGirl
.
create
:generic_commit_status
,
pipeline:
pipeline
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:generic_commit_status
)
do
create
(
:generic_commit_status
,
pipeline:
pipeline
)
end
describe
'#context'
do
subject
{
generic_commit_status
.
context
}
...
...
@@ -17,6 +20,15 @@ describe GenericCommitStatus, models: true do
it
{
is_expected
.
to
eq
([
:external
])
}
end
describe
'#detailed_status'
do
let
(
:user
)
{
create
(
:user
)
}
it
'returns detailed status object'
do
expect
(
generic_commit_status
.
detailed_status
(
user
))
.
to
be_a
Gitlab
::
Ci
::
Status
::
Success
end
end
describe
'set_default_values'
do
before
do
generic_commit_status
.
context
=
nil
...
...
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