From 0f0854cd60aebde1b4a69e455ee40686c4ab0353 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Thu, 15 Sep 2011 11:50:21 +0100 Subject: Simplify the "Send follow up" / "Reply" UI: only offer singe "Write a reply" option, and on the next page, give the user the opportunity to change the recipient from the default (the last valid sender of a message) to any other valid recipient. Closes #35. --- spec/controllers/request_controller_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'spec/controllers/request_controller_spec.rb') diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index b4aef8470..aa3027c00 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -533,6 +533,22 @@ describe RequestController, "when viewing an individual response for reply/follo response.should render_template('show_response') end + it "should offer the opportunity to reply to the main address" do + session[:user_id] = users(:bob_smith_user).id + get :show_response, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message) + response.body.should have_tag("div#other_recipients ul li", /the main FOI contact address for/) + end + + it "should offer an opportunity to reply to another address" do + session[:user_id] = users(:bob_smith_user).id + ir = info_requests(:fancy_dog_request) + ir.allow_new_responses_from = "anybody" + ir.save! + receive_incoming_mail('incoming-request-plain.email', ir.incoming_email, "Frob ") + get :show_response, :id => ir.id, :incoming_message_id => incoming_messages(:useless_incoming_message) + response.body.should have_tag("div#other_recipients ul li", /Frob/) + end + it "should not show individual responses if request hidden, even if request owner" do ir = info_requests(:fancy_dog_request) ir.prominence = 'hidden' -- cgit v1.2.3