aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-09-15 11:50:21 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-09-15 11:50:21 +0100
commit0f0854cd60aebde1b4a69e455ee40686c4ab0353 (patch)
tree03952ada60ec683994d301659e50376cf64bf35b /spec/controllers
parent1def714bd60164afe10b0b9d83b87fec27d9617c (diff)
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.
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/request_controller_spec.rb16
1 files changed, 16 insertions, 0 deletions
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 <frob@bonce.com>")
+ 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'