DEV: Add spec for not_staged user scope (#17042)

Making sure to test this new scope.

Follow up to: 27d7b0c6de

as well as: 3941bad075
This commit is contained in:
Blake Erickson
2022-06-08 10:43:21 -06:00
committed by GitHub
parent 03732049ed
commit 852a2f1727

View File

@@ -1887,6 +1887,16 @@ RSpec.describe User do
end
end
describe '.not_staged' do
let!(:user0) { Fabricate(:user, staged: true) }
let!(:user1) { Fabricate(:user) }
it "doesn't return staged users" do
expect(User.not_staged).to_not include(user0)
expect(User.not_staged).to include(user1)
end
end
describe '#publish_notifications_state' do
it 'should publish the right message sorted by ID desc' do
notification = Fabricate(:notification, user: user)