diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-04-15 14:25:59 +1000 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-04-15 14:25:59 +1000 |
commit | 9fa6cb0ce17787aceaf9fd5c12ff6bc42b91e193 (patch) | |
tree | 368738f3aec5a91e72a1311a0e9b5b501fcd2466 /spec/models/info_request_spec.rb | |
parent | 3eac44240aa178aeec1774dc257c956b79cc49bf (diff) |
Add test for events in another situation
Diffstat (limited to 'spec/models/info_request_spec.rb')
-rw-r--r-- | spec/models/info_request_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index eb4fb38c1..afbff2152 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -654,6 +654,34 @@ describe InfoRequest do event3.described_state.should == "waiting_response" event3.calculated_state.should == "waiting_response" end + + it "should have sensible events after a user classifies the request after a follow up" do + # An initial request is sent + request.log_event('sent', {}) + request.set_described_state('waiting_response') + # A response is received + request.awaiting_description = true + request.log_event("response", {}) + # The request is classified by the requesting user + request.set_described_state("waiting_response") + # A normal follow up is sent + request.log_event('followup_sent', {}) + request.set_described_state('waiting_response') + # The request is classified by the requesting user + request.set_described_state("waiting_response") + + request.info_request_events.count.should == 3 + event1, event2, event3 = request.info_request_events + event1.event_type.should == "sent" + event1.described_state.should == "waiting_response" + event1.calculated_state.should == "waiting_response" + event2.event_type.should == "response" + event2.described_state.should == "waiting_response" + event2.calculated_state.should == "waiting_response" + event3.event_type.should == "followup_sent" + event3.described_state.should == "waiting_response" + event3.calculated_state.should == "waiting_response" + end end end end |