tests: add daily & weekly maintenance tests.

This commit is contained in:
evazion
2018-04-11 20:50:27 -05:00
parent 4233d2149f
commit 159b0e8a22
2 changed files with 46 additions and 0 deletions

View 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