From 77a923dd67d9638d1dc7b3b731e3e654b6b67475 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 11 Aug 2014 11:58:30 +0100 Subject: Use since_event_id to restrict query, not just data displayed. Allow the same params (since_event_id, since_date) for both formats. There doesn't seem to be a particular reason not to treat them the same. --- spec/controllers/api_controller_spec.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (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 7b1d73e8a..323ef4cd4 100644 --- a/spec/controllers/api_controller_spec.rb +++ b/spec/controllers/api_controller_spec.rb @@ -514,7 +514,7 @@ describe ApiController, "when using the API" do assigns[:event_data].should == [first_event] end - it 'should honour the since_date parameter for the Atom feed' do + it 'should honour the since_date parameter' do get :body_request_events, :id => public_bodies(:humpadink_public_body).id, :k => public_bodies(:humpadink_public_body).api_key, @@ -527,6 +527,15 @@ describe ApiController, "when using the API" do assigns[:events].each do |event| event.created_at.should >= Date.new(2010, 1, 1) end + + get :body_request_events, + :id => public_bodies(:humpadink_public_body).id, + :k => public_bodies(:humpadink_public_body).api_key, + :since_date => '2010-01-01', + :feed_type => 'json' + assigns[:events].each do |event| + event.created_at.should >= Date.new(2010, 1, 1) + end end end end -- cgit v1.2.3