From d9136f001e20df18928c1a6818347930fae27a52 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 28 Jan 2014 09:17:45 +0000 Subject: Handle a request with no user in the show request function --- spec/controllers/api_controller_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (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 8e9d17fbe..2b1c515f7 100644 --- a/spec/controllers/api_controller_spec.rb +++ b/spec/controllers/api_controller_spec.rb @@ -282,6 +282,18 @@ describe ApiController, "when using the API" do # check, which does not really test anything at all. end + it 'should show information about an external request' do + info_request = info_requests(:external_request) + get :show_request, + :k => public_bodies(:geraldine_public_body).api_key, + :id => info_request.id + + response.should be_success + assigns[:request].id.should == info_request.id + r = ActiveSupport::JSON.decode(response.body) + r["title"].should == info_request.title + end + it "should show an Atom feed of new request events" do get :body_request_events, :id => public_bodies(:geraldine_public_body).id, -- cgit v1.2.3