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
32ab86d4
Commit
32ab86d4
authored
Jan 17, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for a new external build detailed status
parent
b222f6d5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
generic_commit_status_spec.rb
spec/models/generic_commit_status_spec.rb
+22
-4
No files found.
spec/models/generic_commit_status_spec.rb
View file @
32ab86d4
require
'spec_helper'
require
'spec_helper'
describe
GenericCommitStatus
,
models:
true
do
describe
GenericCommitStatus
,
models:
true
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
(
:external_url
)
{
'http://example.gitlab.com/status'
}
let
(
:generic_commit_status
)
do
let
(
:generic_commit_status
)
do
create
(
:generic_commit_status
,
pipeline:
pipeline
)
create
(
:generic_commit_status
,
pipeline:
pipeline
,
target_url:
external_url
)
end
end
describe
'#context'
do
describe
'#context'
do
...
@@ -22,10 +25,25 @@ describe GenericCommitStatus, models: true do
...
@@ -22,10 +25,25 @@ describe GenericCommitStatus, models: true do
describe
'#detailed_status'
do
describe
'#detailed_status'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:status
)
{
generic_commit_status
.
detailed_status
(
user
)
}
it
'returns detailed status object'
do
it
'returns detailed status object'
do
expect
(
generic_commit_status
.
detailed_status
(
user
))
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Success
.
to
be_a
Gitlab
::
Ci
::
Status
::
Success
end
context
'when user has ability to see datails'
do
before
{
project
.
team
<<
[
user
,
:developer
]
}
it
'details path points to an external URL'
do
expect
(
status
).
to
have_details
expect
(
status
.
details_path
).
to
eq
external_url
end
end
context
'when user should not see details'
do
it
'does not have details'
do
expect
(
status
).
not_to
have_details
end
end
end
end
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