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
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
build_spec.rb
spec/models/build_spec.rb
+9
-0
commit_status_spec.rb
spec/models/commit_status_spec.rb
+9
-0
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