diff options
-rw-r--r-- | app/views/request_mailer/overdue_alert.rhtml | 5 | ||||
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 21 |
2 files changed, 21 insertions, 5 deletions
diff --git a/app/views/request_mailer/overdue_alert.rhtml b/app/views/request_mailer/overdue_alert.rhtml index ab2faf212..d14abc419 100644 --- a/app/views/request_mailer/overdue_alert.rhtml +++ b/app/views/request_mailer/overdue_alert.rhtml @@ -1,11 +1,10 @@ <%= @info_request.public_body.name %> are late. They have not replied to your <%=@info_request.law_used_short%> request '<%= @info_request.title %>' -promptly, as required by law. +promptly, as normally required by law <% if @info_request.public_body.is_school? %>during term time<% end %>. Click on the link below to send a message to <%= @info_request.public_body.name -%> reminding them to reply to your request. <% if @info_request.public_body.is_school? %> This is a school, so legally they get lots of extra slack if it is holiday time. <% end %> - +%> reminding them to reply to your request. <%=@url%> -- the WhatDoTheyKnow team diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index ec396aa3b..1ab68cd03 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -848,7 +848,7 @@ describe RequestController, "sending overdue request alerts" do deliveries = ActionMailer::Base.deliveries deliveries.size.should == 1 mail = deliveries[0] - mail.body.should =~ /promptly, as required by law/ + mail.body.should =~ /promptly, as normally\s+required by law/ mail.to_addrs.to_s.should == info_requests(:naughty_chicken_request).user.name_and_email mail.body =~ /(http:\/\/.*\/c\/(.*))/ @@ -863,7 +863,24 @@ describe RequestController, "sending overdue request alerts" do assigns[:info_request].should == info_requests(:naughty_chicken_request) end - it "should send not actualy send the overdue alert if the user is banned" do + it "should include clause for schools when sending an overdue alert mail to creators of overdue requests" do + chicken_request = info_requests(:naughty_chicken_request) + chicken_request.outgoing_messages[0].last_sent_at = Time.now() - 30.days + chicken_request.outgoing_messages[0].save! + + chicken_request.public_body.tag_string = "school" + chicken_request.public_body.save! + + RequestMailer.alert_overdue_requests + + deliveries = ActionMailer::Base.deliveries + deliveries.size.should == 1 + mail = deliveries[0] + mail.body.should =~ /promptly, as normally\s+required by law during term time/ + mail.to_addrs.to_s.should == info_requests(:naughty_chicken_request).user.name_and_email + end + + it "should send not actually send the overdue alert if the user is banned" do user = info_requests(:naughty_chicken_request).user user.ban_text = 'Banned' user.save! |