diff options
| author | Louise Crow <louise.crow@gmail.com> | 2014-08-11 11:58:30 +0100 | 
|---|---|---|
| committer | Louise Crow <louise.crow@gmail.com> | 2014-08-11 12:30:30 +0100 | 
| commit | 77a923dd67d9638d1dc7b3b731e3e654b6b67475 (patch) | |
| tree | c50e54eda7bc6d9b3abbb33fb3e5403cd740b5de /spec/controllers/api_controller_spec.rb | |
| parent | a760114de869ce3f07358dde19b8b5cc5d36003b (diff) | |
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.
Diffstat (limited to 'spec/controllers/api_controller_spec.rb')
| -rw-r--r-- | spec/controllers/api_controller_spec.rb | 11 | 
1 files changed, 10 insertions, 1 deletions
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  | 
