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
655b2640
Commit
655b2640
authored
May 04, 2016
by
Benedikt Huss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge request widget displays TeamCity build state and code coverage correctly again
parent
915a4193
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
6 deletions
+41
-6
app/assets/javascripts/merge_request_widget.js.coffee
app/assets/javascripts/merge_request_widget.js.coffee
+6
-6
spec/javascripts/merge_request_widget_spec.js.coffee
spec/javascripts/merge_request_widget_spec.js.coffee
+35
-0
No files found.
app/assets/javascripts/merge_request_widget.js.coffee
View file @
655b2640
...
@@ -68,13 +68,13 @@ class @MergeRequestWidget
...
@@ -68,13 +68,13 @@ class @MergeRequestWidget
$
.
getJSON
@
opts
.
ci_status_url
,
(
data
)
=>
$
.
getJSON
@
opts
.
ci_status_url
,
(
data
)
=>
@
readyForCICheck
=
true
@
readyForCICheck
=
true
if
@
firstCICheck
if
@
firstCICheck
||
@
opts
.
ci_status
is
''
@
firstCICheck
=
false
if
@
firstCICheck
@
firstCICheck
=
false
@
opts
.
ci_status
=
data
.
status
@
opts
.
ci_status
=
data
.
status
@
showCIStatus
data
.
status
if
@
opts
.
ci_status
is
''
if
data
.
coverage
@
opts
.
ci_status
=
data
.
status
@
showCICoverage
data
.
coverage
return
if
data
.
status
isnt
@
opts
.
ci_status
and
data
.
status
?
if
data
.
status
isnt
@
opts
.
ci_status
and
data
.
status
?
@
showCIStatus
data
.
status
@
showCIStatus
data
.
status
...
...
spec/javascripts/merge_request_widget_spec.js.coffee
0 → 100644
View file @
655b2640
#= require merge_request_widget
describe
'MergeRequestWidget'
,
->
beforeEach
->
window
.
notifyPermissions
=
()
->
@
opts
=
{
ci_status_url
:
"http://sampledomain.local/ci/getstatus"
,
ci_status
:
""
}
@
class
=
new
MergeRequestWidget
(
@
opts
)
@
ciStatusData
=
{
"title"
:
"Sample MR title"
,
"sha"
:
"12a34bc5"
,
"status"
:
"success"
,
"coverage"
:
98
}
describe
'getCIStatus'
,
->
beforeEach
->
spyOn
(
jQuery
,
'getJSON'
).
and
.
callFake
(
req
,
cb
)
=>
cb
(
@
ciStatusData
)
it
'should call showCIStatus even if a notification should not be displayed'
,
->
spy
=
spyOn
(
@
class
,
'showCIStatus'
).
and
.
stub
()
@
class
.
getCIStatus
(
false
)
expect
(
spy
).
toHaveBeenCalledWith
(
@
ciStatusData
.
status
)
it
'should call showCIStatus when a notification should be displayed'
,
->
spy
=
spyOn
(
@
class
,
'showCIStatus'
).
and
.
stub
()
@
class
.
getCIStatus
(
true
)
expect
(
spy
).
toHaveBeenCalledWith
(
@
ciStatusData
.
status
)
it
'should call showCICoverage when the coverage rate is set'
,
->
spy
=
spyOn
(
@
class
,
'showCICoverage'
).
and
.
stub
()
@
class
.
getCIStatus
(
true
)
expect
(
spy
).
toHaveBeenCalledWith
(
@
ciStatusData
.
coverage
)
it
'should not call showCICoverage when the coverage rate is not set'
,
->
@
ciStatusData
.
coverage
=
null
spy
=
spyOn
(
@
class
,
'showCICoverage'
).
and
.
stub
()
@
class
.
getCIStatus
(
true
)
expect
(
spy
).
not
.
toHaveBeenCalled
()
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