aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/api_controller.rb2
-rw-r--r--spec/controllers/api_controller_spec.rb3
2 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb
index 49b226e4b..e7bea67ef 100644
--- a/app/controllers/api_controller.rb
+++ b/app/controllers/api_controller.rb
@@ -63,6 +63,8 @@ class ApiController < ApplicationController
:smtp_message_id => nil
)
+ request.set_described_state('waiting_response')
+
# Return the URL and ID number.
render :json => {
'url' => make_url("request", request.url_title),
diff --git a/spec/controllers/api_controller_spec.rb b/spec/controllers/api_controller_spec.rb
index 66b8e33f0..8e9d17fbe 100644
--- a/spec/controllers/api_controller_spec.rb
+++ b/spec/controllers/api_controller_spec.rb
@@ -83,6 +83,9 @@ describe ApiController, "when using the API" do
new_request.last_event_forming_initial_request.outgoing_message.body.should == request_data["body"].strip
new_request.public_body_id.should == public_bodies(:geraldine_public_body).id
+ new_request.info_request_events.size.should == 1
+ new_request.info_request_events[0].event_type.should == 'sent'
+ new_request.info_request_events[0].calculated_state.should == 'waiting_response'
end
def _create_request