diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-06-20 14:47:56 -0700 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-06-20 14:47:56 -0700 |
commit | 884eb6b5e51b9e0e8aa5ae5ed0eeb25fcbda685e (patch) | |
tree | d300b9177706025069d358781b2c635ac08ddb8f /spec/controllers | |
parent | 97f8d8340e867bcca0fd349e66a83a2860aaea9f (diff) |
Respond to a (currently unsupported) json request for a public body list with a 406, not a 500 caused by a missing template.
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/public_body_controller_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/controllers/public_body_controller_spec.rb b/spec/controllers/public_body_controller_spec.rb index 22d8418c9..e01bcb0a6 100644 --- a/spec/controllers/public_body_controller_spec.rb +++ b/spec/controllers/public_body_controller_spec.rb @@ -183,8 +183,11 @@ describe PublicBodyController, "when listing bodies" do response.should render_template('list') assigns[:public_bodies].should == [ public_bodies(:humpadink_public_body) ] assigns[:tag].should == "eats_cheese:stilton" + end - + it 'should return a "406 Not Acceptable" code if asked for a json version of a list' do + get :list, :format => 'json' + response.code.should == '406' end end |