diff options
author | francis <francis> | 2009-08-19 00:22:49 +0000 |
---|---|---|
committer | francis <francis> | 2009-08-19 00:22:49 +0000 |
commit | 9242f214beca2f4f3adaec869d2ecf2471747a60 (patch) | |
tree | e8b0539e63d6b1d1f9d56b4f775dea1c111986c4 /spec/controllers/request_controller_spec.rb | |
parent | 91b817de64dc16d7b06c79a96e0deeb21c71e045 (diff) |
Fix subtle bug, which caused error with old data and new not-sending-to-auto-annotations code
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index f40c2770f..783890b40 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -790,7 +790,7 @@ describe RequestController, "comment alerts" do integrate_views fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :raw_emails, :outgoing_messages, :comments # all needed as integrating views - it "should send an alert" do + it "should send an alert (once and once only)" do # delete ficture comment and make new one, so is in last month (as # alerts are only for comments in last month, see # RequestMailer.alert_comment_on_request) @@ -801,9 +801,7 @@ describe RequestController, "comment alerts" do # send comment alert RequestMailer.alert_comment_on_request - deliveries = ActionMailer::Base.deliveries - deliveries.size.should == 1 mail = deliveries[0] mail.body.should =~ /has annotated your/ mail.to_addrs.to_s.should == info_requests(:fancy_dog_request).user.name_and_email @@ -814,6 +812,12 @@ describe RequestController, "comment alerts" do # mail_url.should == comment_url(comments(:silly_comment)) #STDERR.puts mail.body + + # check if we send again, no more go out + deliveries.clear + RequestMailer.alert_comment_on_request + deliveries = ActionMailer::Base.deliveries + deliveries.size.should == 0 end it "should not send an alert when you comment on your own request" do |