aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/track_controller_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin@lenny.robin>2011-09-08 00:56:59 +0100
committerRobin Houston <robin@lenny.robin>2011-09-08 00:56:59 +0100
commit6e0e5e5bed89ff2093e1cca3fa50310f678565fd (patch)
treeae9a198a8134e90ab2a140d699ed6f3248f467cc /spec/controllers/track_controller_spec.rb
parente286a5a91e449ef01b5ce5f23654d1316bffaf53 (diff)
parenta9002cc8e749df6f5961acab8e3e61fd21987fc1 (diff)
Merge branch 'develop' of git@github.com:sebbacon/alaveteli into develop
Conflicts: app/models/request_mailer.rb
Diffstat (limited to 'spec/controllers/track_controller_spec.rb')
-rw-r--r--spec/controllers/track_controller_spec.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb
index 2f3f903f9..8c2e19c58 100644
--- a/spec/controllers/track_controller_spec.rb
+++ b/spec/controllers/track_controller_spec.rb
@@ -16,6 +16,7 @@ describe TrackController, "when making a new track on a request" do
@user = mock_model(User)
User.stub!(:find).and_return(@user)
+ @user.stub!(:locale).and_return("en")
end
it "should require login when making new track" do
@@ -69,7 +70,6 @@ describe TrackController, "when sending alerts for a track" do
mail.body.should include('added an annotation') # comment included
mail.body.should =~ /This a the daftest comment the world has ever seen/ # comment text included
-
# Check subscription managing link
# XXX We can't do this, as it is redirecting to another controller. I'm
# apparently meant to be writing controller unit tests here, not functional
@@ -93,6 +93,19 @@ describe TrackController, "when sending alerts for a track" do
deliveries.size.should == 0
end
+ it "should send localised alerts" do
+ # set the time the comment event happened at to within the last week
+ ire = info_request_events(:silly_comment_event)
+ ire.created_at = Time.now - 3.days
+ ire.save!
+ user = users(:silly_name_user)
+ user.locale = "es"
+ user.save!
+ TrackMailer.alert_tracks
+ deliveries = ActionMailer::Base.deliveries
+ mail = deliveries[0]
+ mail.body.should include('el equipo de ')
+ end
end
describe TrackController, "when viewing RSS feed for a track" do