update maintenance mailer spec for new mail text

This commit is contained in:
Jonne Haß 2014-11-09 19:47:37 +01:00
parent a6701e9172
commit 4be6dc208f

View file

@ -8,15 +8,15 @@ describe Maintenance, :type => :mailer do
describe 'create warning' do
before do
@removal_timestamp = Time.now + 3.days
@user = FactoryGirl.create(:user_with_aspect, :username => "local", :remove_after => @removal_timestamp)
@user = FactoryGirl.create(:user_with_aspect, :username => "local", :remove_after => @removal_timestamp)
end
it "#should deliver successfully" do
expect {
Maintenance.account_removal_warning(@user).deliver
}.to_not raise_error
end
it "#should be added to the delivery queue" do
expect {
Maintenance.account_removal_warning(@user).deliver
@ -27,15 +27,15 @@ describe Maintenance, :type => :mailer do
Maintenance.account_removal_warning(@user).deliver
expect(ActionMailer::Base.deliveries.last.to[0]).to include(@user.email)
end
it "#should include after inactivity days from settings" do
Maintenance.account_removal_warning(@user).deliver
expect(ActionMailer::Base.deliveries.last.body.parts[0].body.raw_source).to include("more than "+AppConfig.settings.maintenance.remove_old_users.after_days.to_s+" days")
expect(ActionMailer::Base.deliveries.last.body.parts[0].body.raw_source).to include("for #{AppConfig.settings.maintenance.remove_old_users.after_days} days")
end
it "#should include timestamp for account removal" do
Maintenance.account_removal_warning(@user).deliver
expect(ActionMailer::Base.deliveries.last.body.parts[0].body.raw_source).to include("logging into the account before "+@removal_timestamp.utc.to_s)
expect(ActionMailer::Base.deliveries.last.body.parts[0].body.raw_source).to include("sign in to your account before #{@removal_timestamp.utc}")
end
end
end