tests: add daily & weekly maintenance tests.
This commit is contained in:
13
test/unit/weekly_maintenance_test.rb
Normal file
13
test/unit/weekly_maintenance_test.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
require 'test_helper'
|
||||
|
||||
class WeeklyMaintenanceTest < ActiveSupport::TestCase
|
||||
context "weekly maintenance" do
|
||||
should "prune password resets" do
|
||||
@user = FactoryBot.create(:user, email: "test@example.com")
|
||||
@nonce = FactoryBot.create(:user_password_reset_nonce, email: "test@example.com", created_at: 1.month.ago)
|
||||
|
||||
WeeklyMaintenance.new.run
|
||||
assert_equal(0, UserPasswordResetNonce.count)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user