diff options
author | francis <francis> | 2008-05-12 00:56:21 +0000 |
---|---|---|
committer | francis <francis> | 2008-05-12 00:56:21 +0000 |
commit | c66db240f11e34c19b02e3e6000cf2c147f9a469 (patch) | |
tree | 579f5eb949620fb6cedb384a2fd4bb44cea5ca7f /spec/controllers/request_controller_spec.rb | |
parent | 214ccea5856fadc2cceba6ce34389847ab4dd207 (diff) |
Fix various things to do with event statuses. Oops.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 4855a88c2..980094e7a 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -225,6 +225,8 @@ describe RequestController, "when classifying an individual response" do response.should redirect_to(:controller => 'help', :action => 'unhappy') info_requests(:fancy_dog_request).reload info_requests(:fancy_dog_request).awaiting_description.should == false + info_requests(:fancy_dog_request).described_state.should == 'rejected' + info_requests(:fancy_dog_request).get_last_response_event.calculated_state.should == 'rejected' end #response.should redirect_to(:action => 'show', :id => info_requests(:fancy_dog_request)) @@ -257,9 +259,16 @@ describe RequestController, "when sending a followup message" do it "should send the follow up message if you are the right user" do + # fake that this is a clarification + info_requests(:fancy_dog_request).set_described_state('waiting_clarification') + info_requests(:fancy_dog_request).described_state.should == 'waiting_clarification' + info_requests(:fancy_dog_request).get_last_response_event.calculated_state.should == 'waiting_clarification' + + # make the followup session[:user_id] = users(:bob_smith_user).id post :show_response, :outgoing_message => { :body => "What a useless response! You suck." }, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message), :submitted_followup => 1 + # check it worked deliveries = ActionMailer::Base.deliveries deliveries.size.should == 1 mail = deliveries[0] @@ -267,6 +276,11 @@ describe RequestController, "when sending a followup message" do mail.to_addrs.to_s.should == "FOI Person <foiperson@localhost>" response.should redirect_to(:action => 'show', :url_title => info_requests(:fancy_dog_request).url_title) + + # and that the status changed + info_requests(:fancy_dog_request).reload + info_requests(:fancy_dog_request).described_state.should == 'waiting_response' + info_requests(:fancy_dog_request).get_last_response_event.calculated_state.should == 'waiting_response' end |