aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/errors_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-06-04 15:12:36 +0100
committerLouise Crow <louise.crow@gmail.com>2013-06-04 15:12:36 +0100
commit1d64718b8eb0fa63bcf6d3853f4bda7b15eb4427 (patch)
treeae425fa3cebe8295af47d288898728c0d764b926 /spec/integration/errors_spec.rb
parent7b9fc0f82acfee43bc42a080f8a1e64c23604a65 (diff)
parenta919141992a40599f99b32bd4a8312a0009f3f7a (diff)
Merge branch 'release/0.11' into rails-3-develop
Diffstat (limited to 'spec/integration/errors_spec.rb')
-rw-r--r--spec/integration/errors_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/integration/errors_spec.rb b/spec/integration/errors_spec.rb
index ed0d7bfec..17a0153c2 100644
--- a/spec/integration/errors_spec.rb
+++ b/spec/integration/errors_spec.rb
@@ -62,6 +62,17 @@ describe "When errors occur" do
response.code.should == "500"
end
+ it 'should render a 500 for json errors' do
+ InfoRequest.stub!(:find_by_url_title!).and_raise("An example error")
+ get("/request/example.json")
+ response.code.should == '500'
+ end
+
+ it 'should render a 404 for a non-found xml request' do
+ get("/frobsnasm.xml")
+ response.code.should == '404'
+ end
+
it 'should notify of a general error' do
InfoRequest.stub!(:find_by_url_title!).and_raise("An example error")
get("/request/example")
@@ -97,6 +108,12 @@ describe "When errors occur" do
response.code.should == "403"
end
+ it "return a 403 for a JSON PermissionDenied error" do
+ InfoRequest.stub!(:find_by_url_title!).and_raise(ApplicationController::PermissionDenied)
+ get("/request/example.json")
+ response.code.should == '403'
+ end
+
context "in the admin interface" do
it 'should show a full trace for general errors' do