summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2014-06-11 15:56:51 -0700
committerdanielsdeleo <dan@getchef.com>2014-06-11 17:01:51 -0700
commit739407f0cc4331edcaa232dc6e5fe16a5cca3217 (patch)
tree2a2040e55e9ad156b76d12ce44dabafe33fa9329
parent8bf683ef0e46963d6cd48b0c679edc32aeb63187 (diff)
downloadchef-739407f0cc4331edcaa232dc6e5fe16a5cca3217.tar.gz
Return rack-compliant 404 messages
-rw-r--r--spec/functional/tiny_server_spec.rb4
-rw-r--r--spec/tiny_server.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/spec/functional/tiny_server_spec.rb b/spec/functional/tiny_server_spec.rb
index 4262d9e536..bfa6ff1ddb 100644
--- a/spec/functional/tiny_server_spec.rb
+++ b/spec/functional/tiny_server_spec.rb
@@ -54,8 +54,8 @@ describe TinyServer::API do
response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => '/no_such_thing')
response[0].should == 404
response[1].should == {'Content-Type' => 'application/json'}
- response[2].should be_a_kind_of(String)
- response_obj = Chef::JSONCompat.from_json(response[2])
+ response[2].should be_a_kind_of(Array)
+ response_obj = Chef::JSONCompat.from_json(response[2].first)
response_obj["message"].should == "no data matches the request for /no_such_thing"
response_obj["available_routes"].should == {"GET"=>[], "PUT"=>[], "POST"=>[], "DELETE"=>[]}
response_obj["request"].should == {"REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"/no_such_thing"}
diff --git a/spec/tiny_server.rb b/spec/tiny_server.rb
index 340c5d5fb6..7e6ef3a809 100644
--- a/spec/tiny_server.rb
+++ b/spec/tiny_server.rb
@@ -152,7 +152,7 @@ module TinyServer
:available_routes => @routes, :request => env}
# Uncomment me for glorious debugging
# pp :not_found => debug_info
- [404, {'Content-Type' => 'application/json'}, debug_info.to_json]
+ [404, {'Content-Type' => 'application/json'}, [ debug_info.to_json ]]
end
end