diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-04-18 12:24:40 +1000 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-04-18 12:24:40 +1000 |
commit | c1a29f8c7331e9121f896ceb45ea36ab64bb09a6 (patch) | |
tree | 3646925208433e62f341ae807d658248b761dd86 | |
parent | 5dbf063744c70dc280d3866f8365ac87f920c383 (diff) |
Test case that shows up event states bug in https://www.whatdotheyknow.com/request/human_rights_and_deprivation_of
-rw-r--r-- | spec/models/info_request_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index f3b07e855..95e89caeb 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -703,6 +703,26 @@ describe InfoRequest do events[1].described_state.should == "internal_review" events[1].calculated_state.should == "internal_review" end + + it "should have sensible event states" do + # An initial request is sent + request.log_event('sent', {}) + request.set_described_state('waiting_response') + # An internal review is requested + request.log_event('followup_sent', {}) + request.set_described_state('internal_review') + # The user marks the request as rejected + request.set_described_state("rejected") + + events = request.info_request_events + events.count.should == 2 + events[0].event_type.should == "sent" + events[0].described_state.should == "waiting_response" + events[0].calculated_state.should == "waiting_response" + events[1].event_type.should == "followup_sent" + events[1].described_state.should == "rejected" + events[1].calculated_state.should == "rejected" + end end end end |