diff --git a/app/assets/javascripts/merge_request_widget.js.coffee b/app/assets/javascripts/merge_request_widget.js.coffee index 31f5cb93a51..963a0550c35 100644 --- a/app/assets/javascripts/merge_request_widget.js.coffee +++ b/app/assets/javascripts/merge_request_widget.js.coffee @@ -55,12 +55,13 @@ class @MergeRequestWidget $('.mr-state-widget').replaceWith(data) ciLabelForStatus: (status) -> - if status is 'success' - 'passed' - else if status is 'success_with_warnings' - 'passed with warnings' - else - status + switch status + when 'success' + 'passed' + when 'success_with_warnings' + 'passed with warnings' + else + status pollCIStatus: -> @fetchBuildStatusInterval = setInterval ( => diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index c9217b846e7..44b8b7f6ca1 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -15,9 +15,10 @@ module CiStatusHelper end def ci_label_for_status(status) - if status == 'success' + case status + when 'success' 'passed' - elsif status == 'success_with_warnings' + when 'success_with_warnings' 'passed with warnings' else status