aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/track_mailer_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/track_mailer_spec.rb')
-rw-r--r--spec/models/track_mailer_spec.rb25
1 files changed, 17 insertions, 8 deletions
diff --git a/spec/models/track_mailer_spec.rb b/spec/models/track_mailer_spec.rb
index 11e34c0cc..a2016f3d1 100644
--- a/spec/models/track_mailer_spec.rb
+++ b/spec/models/track_mailer_spec.rb
@@ -18,9 +18,11 @@ describe TrackMailer do
describe 'for each user' do
before do
- @user = mock_model(User, :last_daily_track_email= => true,
- :save! => true)
+ @user = mock_model(User, :no_reindex= => false,
+ :last_daily_track_email= => true,
+ :save! => true)
User.stub!(:find).and_return([@user])
+ @user.stub!(:no_reindex=)
end
it 'should ask for any daily track things for the user' do
@@ -29,6 +31,19 @@ describe TrackMailer do
TrackMailer.alert_tracks
end
+
+ it 'should set the no_reindex flag on the user' do
+ @user.should_receive(:no_reindex=).with(true)
+ TrackMailer.alert_tracks
+ end
+
+ it 'should update the time of the user\'s last daily tracking email' do
+ @user.should_receive(:last_daily_track_email=).with(Time.now)
+ @user.should_receive(:save!)
+ TrackMailer.alert_tracks
+ end
+
+
describe 'for each tracked thing' do
before do
@@ -84,12 +99,6 @@ describe TrackMailer do
TrackMailer.alert_tracks
end
end
-
- it 'should update the time of the user\'s last daily tracking email' do
- @user.should_receive(:last_daily_track_email=).with(Time.now)
- @user.should_receive(:save!)
- TrackMailer.alert_tracks
- end
end