diff options
author | Francis Irving <francis@mysociety.org> | 2009-12-22 10:43:50 +0000 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2009-12-22 10:43:50 +0000 |
commit | 2a29145dad6ae8cdf599b7a23eb9c9d96b26fe7f (patch) | |
tree | 660fa62c49b972584b81eae4e02d5b658c1d02c3 | |
parent | 3222dc3827b3bcc6669efb633a970b11b0ed3fa3 (diff) |
Test for previewing followups
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 9474b1d77..2d9ff9208 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -798,7 +798,18 @@ describe RequestController, "when sending a followup message" do response.should render_template('show_response') end + it "should show preview when input is good" do + session[:user_id] = users(:bob_smith_user).id + post :show_response, :outgoing_message => { :body => "What a useless response! You suck.", :what_doing => 'normal_sort'}, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message), :submitted_followup => 1, :preview => 1 + response.should render_template('followup_preview') + end + it "should allow re-editing of a preview" do + session[:user_id] = users(:bob_smith_user).id + post :show_response, :outgoing_message => { :body => "What a useless response! You suck.", :what_doing => 'normal_sort'}, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message), :submitted_followup => 1, :preview => 0, :reedit => "Re-edit this request" + response.should render_template('show_response') + end + 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') |