diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-05-28 10:21:36 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-06-06 19:34:58 +0100 |
commit | c2681d8effb64e4f49ab17d867a5616613dea4f7 (patch) | |
tree | 2bb73919d16fa01ad2c5658001cc69d309221f4f /spec | |
parent | 132dc3e9862d85109eb4a0e5946c22d3ec97d4bb (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')
-rw-r--r-- | spec/controllers/api_controller_spec.rb | 3 | ||||
-rw-r--r-- | spec/views/public_body/show.rhtml_spec.rb | 4 |
2 files changed, 4 insertions, 3 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 diff --git a/spec/views/public_body/show.rhtml_spec.rb b/spec/views/public_body/show.rhtml_spec.rb index a37d8be0d..8b7385954 100644 --- a/spec/views/public_body/show.rhtml_spec.rb +++ b/spec/views/public_body/show.rhtml_spec.rb @@ -102,8 +102,8 @@ def mock_event :info_request => mock_model(InfoRequest, :title => 'Title', :url_title => 'title', - :display_status => 'awaiting_response', - :calculate_status => 'awaiting_response', + :display_status => 'waiting_response', + :calculate_status => 'waiting_response', :public_body => @pb, :user => mock_model(User, :name => 'Test User', :url_name => 'testuser') ), |