discourse/spec/jobs/unsilence_users_spec.rb
2022-07-28 10:27:38 +08:00

17 lines
370 B
Ruby

# frozen_string_literal: true
RSpec.describe Jobs::UnsilenceUsers do
it "unsilence users" do
user = Fabricate(:user)
UserSilencer.silence(user, Discourse.system_user, silenced_till: 2.days.ago)
user.reload
expect(user.silenced_till).to be
Jobs::UnsilenceUsers.new.execute({})
user.reload
expect(user.silenced_till).to be(nil)
end
end