From c8de5ff799bb282a586185dbc6c86dad412e6204 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Fri, 4 Jan 2013 12:18:07 +1100 Subject: response.status now returns an integer --- spec/controllers/api_controller_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spec/controllers/api_controller_spec.rb') diff --git a/spec/controllers/api_controller_spec.rb b/spec/controllers/api_controller_spec.rb index 1c320f85c..aeb452afe 100644 --- a/spec/controllers/api_controller_spec.rb +++ b/spec/controllers/api_controller_spec.rb @@ -173,7 +173,7 @@ describe ApiController, "when using the API" do "body" => "xxx" }.to_json - response.status.should == "500 Internal Server Error" + response.status.should == 500 ActiveSupport::JSON.decode(response.body)["errors"].should == [ "Request #{request_id} cannot be updated using the API"] @@ -195,7 +195,7 @@ describe ApiController, "when using the API" do "body" => "xxx" }.to_json - response.status.should == "500 Internal Server Error" + response.status.should == 500 ActiveSupport::JSON.decode(response.body)["errors"].should == [ "You do not own request #{request_id}"] @@ -218,7 +218,7 @@ describe ApiController, "when using the API" do # Make sure it worked - response.status.to_i.should == 500 + response.status.should == 500 errors = ActiveSupport::JSON.decode(response.body)["errors"] errors.should == ["You cannot attach files to messages in the 'request' direction"] end @@ -360,7 +360,7 @@ describe ApiController, "when using the API" do "sent_at" => sent_at, "body" => response_body }.to_json - response.status.should == "404 Not Found" + response.status.should == 404 ActiveSupport::JSON.decode(response.body)["errors"].should == ["Could not find request 123459876"] end @@ -376,7 +376,7 @@ describe ApiController, "when using the API" do "sent_at" => sent_at, "body" => response_body }.to_json - response.status.should == "500 Internal Server Error" + response.status.should == 500 ActiveSupport::JSON.decode(response.body)["errors"].should == ["Request #{request_id} cannot be updated using the API"] end end -- cgit v1.2.3