aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-05-28 10:21:36 +0100
committerRobin Houston <robin.houston@gmail.com>2012-06-06 19:34:58 +0100
commitc2681d8effb64e4f49ab17d867a5616613dea4f7 (patch)
tree2bb73919d16fa01ad2c5658001cc69d309221f4f /spec/controllers
parent132dc3e9862d85109eb4a0e5946c22d3ec97d4bb (diff)
API create_request method is working
"when using the API", it "should create a new request from a POST", AND IT DOES!
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/api_controller_spec.rb3
1 files changed, 2 insertions, 1 deletions
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