diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-04-18 13:03:20 +1000 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-04-18 13:21:15 +1000 |
commit | d7e9cb9991db045d9e73a017a7d5fbd676311031 (patch) | |
tree | 454d66472bab059c70ef001781462c6fe09545b8 | |
parent | c1a29f8c7331e9121f896ceb45ea36ab64bb09a6 (diff) |
Test case that shows up event states bug in https://www.whatdotheyknow.com/details/request/family_support_worker_redundanci
-rw-r--r-- | spec/models/info_request_spec.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index 95e89caeb..2e79eccc6 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -723,7 +723,24 @@ describe InfoRequest do events[1].described_state.should == "rejected" events[1].calculated_state.should == "rejected" end - end + end + + context "another series of events on a request" do + it "should have sensible event states" do + # An initial request is sent + request.log_event('sent', {}) + request.set_described_state('waiting_response') + # The user marks the request as successful (I know silly but someone did + # this in https://www.whatdotheyknow.com/request/family_support_worker_redundanci) + request.set_described_state("successful") + + events = request.info_request_events + events.count.should == 1 + events[0].event_type.should == "sent" + events[0].described_state.should == "successful" + events[0].calculated_state.should == "successful" + end + end end end end |