aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb <caleb.tutty@nzherald.co.nz>2015-04-20 11:33:23 +1200
committerCaleb <caleb.tutty@nzherald.co.nz>2015-04-20 11:33:23 +1200
commit30ac083e66c9ffe1d8de9f641b6a703c37fc0c49 (patch)
tree6b1fcabc2ab94797896028179b47d91fa8ed80ec
parent5b67028416beb954311ae6b7fd6852939c7dd8dc (diff)
Fixed status check helper
-rw-r--r--app/helpers/health_checks_helper.rb2
-rw-r--r--spec/helpers/health_checks_helper_spec.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/app/helpers/health_checks_helper.rb b/app/helpers/health_checks_helper.rb
index f5769a9ba..f9e4d42df 100644
--- a/app/helpers/health_checks_helper.rb
+++ b/app/helpers/health_checks_helper.rb
@@ -1,7 +1,7 @@
module HealthChecksHelper
def check_status(check)
- style = check.ok? ? {} : "color: red"
+ style = check.ok? ? '' : 'color: red'
content_tag(:b, check.message, :style => style)
end
diff --git a/spec/helpers/health_checks_helper_spec.rb b/spec/helpers/health_checks_helper_spec.rb
index 7d4083da5..7dbfaf06e 100644
--- a/spec/helpers/health_checks_helper_spec.rb
+++ b/spec/helpers/health_checks_helper_spec.rb
@@ -10,6 +10,11 @@ describe HealthChecksHelper do
expect(check_status(check)).to include('red')
end
+ it 'sets style to a blank string if ok' do
+ check = double(:message => '', :ok? => true)
+ expect(check_status(check)).to include('style=""')
+ end
+
end
end