Commit 737e5226 authored by Connor Shea's avatar Connor Shea

Use switch statements instead of if/else chains.

parent b2a79554
...@@ -55,12 +55,13 @@ class @MergeRequestWidget ...@@ -55,12 +55,13 @@ class @MergeRequestWidget
$('.mr-state-widget').replaceWith(data) $('.mr-state-widget').replaceWith(data)
ciLabelForStatus: (status) -> ciLabelForStatus: (status) ->
if status is 'success' switch status
'passed' when 'success'
else if status is 'success_with_warnings' 'passed'
'passed with warnings' when 'success_with_warnings'
else 'passed with warnings'
status else
status
pollCIStatus: -> pollCIStatus: ->
@fetchBuildStatusInterval = setInterval ( => @fetchBuildStatusInterval = setInterval ( =>
......
...@@ -15,9 +15,10 @@ module CiStatusHelper ...@@ -15,9 +15,10 @@ module CiStatusHelper
end end
def ci_label_for_status(status) def ci_label_for_status(status)
if status == 'success' case status
when 'success'
'passed' 'passed'
elsif status == 'success_with_warnings' when 'success_with_warnings'
'passed with warnings' 'passed with warnings'
else else
status status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment