From f560987ab0d3ea3471837a2b30d30c7101dc5616 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Tue, 12 Jun 2012 09:55:16 +0100 Subject: Make emails requesting admin attention appear to come from the user who requested the attention, not the user who made the original request. --- spec/controllers/request_controller_spec.rb | 10 ++++++++++ 1 file changed, 10 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 c70284748..daa26c71e 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -1883,6 +1883,16 @@ describe RequestController, "when reporting a request" do response.body.should include("The site administrators have reviewed this request") end + it "should send an email from the reporter to admins" do + ir = info_requests(:badger_request) + title = ir.url_title + post :report_request, :url_title => title + deliveries = ActionMailer::Base.deliveries + deliveries.size.should == 1 + mail = deliveries[0] + mail.subject.should =~ /attention_requested/ + mail.from.should include(@user.email) + end end -- cgit v1.2.3