From c2681d8effb64e4f49ab17d867a5616613dea4f7 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Mon, 28 May 2012 10:21:36 +0100 Subject: API create_request method is working "when using the API", it "should create a new request from a POST", AND IT DOES! --- spec/controllers/api_controller_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 dec652361..9d072e359 100644 --- a/spec/controllers/api_controller_spec.rb +++ b/spec/controllers/api_controller_spec.rb @@ -19,6 +19,7 @@ describe ApiController, "when using the API" do response.content_type.should == "application/json" response_body = ActiveSupport::JSON.decode(response.body) + response_body["errors"].should be_nil response_body["url"].should =~ /^http/ InfoRequest.count(:conditions => ["public_body_id = ?", geraldine.id]).should == number_of_requests + 1 @@ -29,6 +30,6 @@ describe ApiController, "when using the API" do new_request.external_url.should == request_data["external_url"] new_request.title.should == request_data["title"] - new_request.last_event_forming_initial_request.outgoing_message.body.should == request_data["body"] + new_request.last_event_forming_initial_request.outgoing_message.body.should == request_data["body"].strip end end -- cgit v1.2.3