aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/health_checks_controller_spec.rb
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-09-30 13:56:59 +0100
committerGareth Rees <gareth@mysociety.org>2014-09-30 13:56:59 +0100
commitc64360898beca1162a1bdef9ca4b76676e0907f8 (patch)
tree5c0452a20ce0310f72d0741b171085c5efe1d312 /spec/controllers/health_checks_controller_spec.rb
parente5a9052a9ffd27117775e8adaeaa2e24607e8000 (diff)
parent3a40bfc8a8abbfedb554215849b1c6372864eb1f (diff)
Merge branch 'issues/1827-healthcheck' into rails-3-develop
Diffstat (limited to 'spec/controllers/health_checks_controller_spec.rb')
-rw-r--r--spec/controllers/health_checks_controller_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/controllers/health_checks_controller_spec.rb b/spec/controllers/health_checks_controller_spec.rb
new file mode 100644
index 000000000..f7ad6d6a4
--- /dev/null
+++ b/spec/controllers/health_checks_controller_spec.rb
@@ -0,0 +1,30 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe HealthChecksController do
+
+ describe :index do
+
+ describe :index do
+
+ it 'returns a 200 if all health checks pass' do
+ HealthChecks.stub(:ok? => true)
+ get :index
+ expect(response.status).to eq(200)
+ end
+
+ it 'returns a 500 if the health check fails' do
+ HealthChecks.stub(:ok? => false)
+ get :index
+ expect(response.status).to eq(500)
+ end
+
+ it 'does not render a layout' do
+ get :index
+ expect(response).to render_template(:layout => false)
+ end
+
+ end
+
+ end
+
+end