diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-06-03 18:01:11 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-06-03 18:01:11 +0100 |
commit | af003d8cd5909e1c7e1827d70f9ed7dd9586d738 (patch) | |
tree | ac56038a4361b812850865f4f11e7020f280462d /spec/integration/errors_spec.rb | |
parent | e30a8623a1706d3bad4476198085547d8f47cc88 (diff) | |
parent | 9a4b220be62dcaceee45c70316c1a58a92abcfc5 (diff) |
Merge branch 'hotfix/0.11.0.1' into release/0.110.11.0.1
Diffstat (limited to 'spec/integration/errors_spec.rb')
-rw-r--r-- | spec/integration/errors_spec.rb | 17 |
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 |