diff options
-rw-r--r-- | spec/controllers/api_controller_spec.rb | 12 | ||||
-rw-r--r-- | spec/fixtures/info_request_events.yml | 10 | ||||
-rw-r--r-- | spec/fixtures/info_requests.yml | 10 | ||||
-rw-r--r-- | spec/fixtures/outgoing_messages.yml | 11 |
4 files changed, 39 insertions, 4 deletions
diff --git a/spec/controllers/api_controller_spec.rb b/spec/controllers/api_controller_spec.rb index cd47cc2f2..e5422d48a 100644 --- a/spec/controllers/api_controller_spec.rb +++ b/spec/controllers/api_controller_spec.rb @@ -74,8 +74,8 @@ describe ApiController, "when using the API" do end it "should add a response to a request" do - # First we need to create a request - request_id = _create_request + # First we need an external request + request_id = info_requests(:external_request).id # Initially it has no incoming messages IncomingMessage.count(:conditions => ["info_request_id = ?", request_id]).should == 0 @@ -104,7 +104,7 @@ describe ApiController, "when using the API" do it "should add a followup to a request" do # First we need to create a request - request_id = _create_request + request_id = info_requests(:external_request).id # Initially it has one outgoing message OutgoingMessage.count(:conditions => ["info_request_id = ?", request_id]).should == 1 @@ -172,7 +172,11 @@ describe ApiController, "when using the API" do OutgoingMessage.count.should == n_outgoing_messages end - it "should allow attachments to be uploaded" do + it "should not allow files to be attached to a followup" do + + end + + it "should allow files to be attached to a response" do end diff --git a/spec/fixtures/info_request_events.yml b/spec/fixtures/info_request_events.yml index 3266ec634..e3e8a4460 100644 --- a/spec/fixtures/info_request_events.yml +++ b/spec/fixtures/info_request_events.yml @@ -150,3 +150,13 @@ spam_2_incoming_message_event: described_state: successful calculated_state: successful +external_outgoing_message_event: + id: 914 + params_yaml: "--- \n\ + :outgoing_message_id: 8\n" + outgoing_message_id: 8 + info_request_id: 109 + event_type: sent + created_at: 2009-01-02 02:23:45.6789100 + described_state: waiting_response + calculated_state: waiting_response diff --git a/spec/fixtures/info_requests.yml b/spec/fixtures/info_requests.yml index b347be76b..e4f2287c0 100644 --- a/spec/fixtures/info_requests.yml +++ b/spec/fixtures/info_requests.yml @@ -78,3 +78,13 @@ spam_2_request: described_state: successful awaiting_description: false idhash: 173fd005 +external_request: + id: 109 + title: Balalas + url_title: balalas + external_user_name: Bob Smith + external_url: http://www.example.org/request/balala + public_body_id: 2 + described_state: waiting_response + awaiting_description: false + idhash: a1234567 diff --git a/spec/fixtures/outgoing_messages.yml b/spec/fixtures/outgoing_messages.yml index d33ca4292..32b322bd7 100644 --- a/spec/fixtures/outgoing_messages.yml +++ b/spec/fixtures/outgoing_messages.yml @@ -86,3 +86,14 @@ spam_2_outgoing_message: updated_at: 2007-01-12 02:56:58.586598 what_doing: normal_sort +external_outgoing_message: + id: 8 + info_request_id: 109 + message_type: initial_request + status: sent + body: "I should like to know about balalas." + last_sent_at: 2009-01-12 01:57:58.586598 + created_at: 2009-01-12 01:56:58.586598 + updated_at: 2009-01-12 01:56:58.586598 + what_doing: normal_sort + |