diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-09-10 17:10:44 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-09-10 17:40:38 +0100 |
commit | 52c3e28d09fd75fdbf467c96909e20a86aeaa7fa (patch) | |
tree | 63e2be7c03115d4274bdbed51d9e918511481ec8 /spec/controllers/api_controller_spec.rb | |
parent | 2882543a8fcad4c38a9b45fa7e493ea04ee02d65 (diff) |
Add a since_date parameter to the API feed
Diffstat (limited to 'spec/controllers/api_controller_spec.rb')
-rw-r--r-- | spec/controllers/api_controller_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/controllers/api_controller_spec.rb b/spec/controllers/api_controller_spec.rb index 925b7adb4..ded9a040a 100644 --- a/spec/controllers/api_controller_spec.rb +++ b/spec/controllers/api_controller_spec.rb @@ -320,6 +320,21 @@ 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 + 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 => "atom" + + response.should be_success + response.should render_template("api/request_events.atom") + assigns[:events].size.should > 0 + assigns[:events].each do |event| + event.created_at.should >= Date.new(2010, 1, 1) + end + end + it "should return a JSON 404 error for non-existent requests" do request_id = 123459876 # Let's hope this doesn't exist! sent_at = "2012-05-28T12:35:39+01:00" |