Skip to content

Commit

Permalink
Fix with syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Dec 1, 2024
1 parent cf87d8b commit 8c747b7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/models/user_cleaner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ def test_non_confirmed_user(confirmation_sent_date, expected_inactive_users_coun
describe("mails") do
context "when setting a deletion date" do
it "enqueues a deletion warning mail (40 days)" do
FactoryBot.create(:confirmed_user, current_sign_in_at: 7.months.ago)
user = FactoryBot.create(:confirmed_user, current_sign_in_at: 7.months.ago)

expect do
UserCleaner.new.set_deletion_date_for_inactive_users
end.to(have_enqueued_mail(UserCleanerMailer, :pending_deletion_email)
.with { |args| expect(args).to include(40) })
.with(user.email, user.locale, 40))
end

it "does not enqueue a deletion warning mail (40 days) for non-generic users" do
Expand All @@ -213,12 +213,12 @@ def test_non_confirmed_user(confirmation_sent_date, expected_inactive_users_coun

context "when a deletion date is assigned" do
def test_enqueues_additional_deletion_warning_mails(num_days)
FactoryBot.create(:confirmed_user, deletion_date: Date.current + num_days.days)
user = FactoryBot.create(:confirmed_user, deletion_date: Date.current + num_days.days)

expect do
UserCleaner.new.send_additional_warning_mails
end.to(have_enqueued_mail(UserCleanerMailer, :pending_deletion_email)
.with { |args| expect(args).to include(num_days) })
.with(user.email, user.locale, num_days))
end

it "enqueues additional deletion warning mails" do
Expand Down Expand Up @@ -248,12 +248,12 @@ def test_enqueues_additional_deletion_warning_mails(num_days)

context "when a user is finally deleted" do
it "enqueues a deletion mail" do
FactoryBot.create(:confirmed_user, deletion_date: Date.current - 1.day)
user = FactoryBot.create(:confirmed_user, deletion_date: Date.current - 1.day)

expect do
UserCleaner.new.delete_users_according_to_deletion_date!
end.to(have_enqueued_mail(UserCleanerMailer, :deletion_email)
.with { |args| expect(args).to include(user.email) })
.with(user.email, user.locale))
end
end
end
Expand All @@ -265,7 +265,7 @@ def test_enqueues_additional_deletion_warning_mails(num_days)
def test_subject_line(num_days)
user = FactoryBot.create(:confirmed_user)
mailer = UserCleanerMailer
.pending_deletion_email(user.email, user.locale, 40, num_days)
.pending_deletion_email(user.email, user.locale, num_days)
expect(mailer.subject).to include(num_days.to_s)
end

Expand Down

0 comments on commit 8c747b7

Please sign in to comment.