diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-04-15 13:17:54 +1000 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-04-15 13:17:54 +1000 |
commit | 287a37d119823b99f444b53d5c11ad375149afa8 (patch) | |
tree | 9db5dbeeff6fa50adb664b136d43233cdf4402c9 /spec/models/info_request_spec.rb | |
parent | 270f65d519140dbb490371d2acece701d9c47811 (diff) |
Test to check event states after initial request is sent
Diffstat (limited to 'spec/models/info_request_spec.rb')
-rw-r--r-- | spec/models/info_request_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index 3eb88b2bb..fe53b983b 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -565,4 +565,18 @@ describe InfoRequest do end + describe "#set_described_state" do + it "should have sensible events after the initial request has been made" do + request = InfoRequest.create!(:title => "my request", + :public_body => public_bodies(:geraldine_public_body), + :user => users(:bob_smith_user)) + request.log_event('sent', {}) + request.set_described_state('waiting_response') + + request.info_request_events.count.should == 1 + event = request.info_request_events.first + event.described_state.should == "waiting_response" + event.calculated_state.should == "waiting_response" + end + end end |