aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/errors_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-05-02 10:23:26 +0100
committerLouise Crow <louise.crow@gmail.com>2013-05-02 13:28:31 +0100
commit6acce073443fbd700f346b1bf99ee72be3e4f387 (patch)
tree2d6c4277e7f11103217b4749cf8dfbca6b5eaba1 /spec/integration/errors_spec.rb
parent0d9045ca1c6b2e2c2889e9237ed96ad689eec902 (diff)
Clearer setting of status code, addition of notification.
Diffstat (limited to 'spec/integration/errors_spec.rb')
-rw-r--r--spec/integration/errors_spec.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/integration/errors_spec.rb b/spec/integration/errors_spec.rb
index 6069a69b8..ccf3c4379 100644
--- a/spec/integration/errors_spec.rb
+++ b/spec/integration/errors_spec.rb
@@ -3,15 +3,12 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe "When errors occur" do
def set_consider_all_requests_local(value)
- # Reload application controller so it picks up new config value
@requests_local = Rails.application.config.consider_all_requests_local
Rails.application.config.consider_all_requests_local = value
- load 'application_controller.rb'
end
def restore_consider_all_requests_local
Rails.application.config.consider_all_requests_local = @requests_local
- load "application_controller.rb"
end
before(:each) do
@@ -56,6 +53,7 @@ describe "When errors occur" do
end
end
+
it "should render a 500 for general errors using the general/exception_caught template" do
InfoRequest.stub!(:find_by_url_title!).and_raise("An example error")
get("/request/example")
@@ -94,12 +92,16 @@ describe "When errors occur" do
end
context "in the admin interface" do
+
it 'should show a full trace for general errors' do
InfoRequest.stub!(:find).and_raise("An example error")
get("/admin/request/show/333")
response.body.should have_selector('div[id=traces]')
response.body.should match('An example error')
end
+
end
+
end
+
end