From 852a2f17274cf780a173123c1aad271ae8ca4c4a Mon Sep 17 00:00:00 2001
From: Blake Erickson <o.blakeerickson@gmail.com>
Date: Wed, 8 Jun 2022 10:43:21 -0600
Subject: [PATCH] DEV: Add spec for not_staged user scope (#17042)

Making sure to test this new scope.

Follow up to: 27d7b0c6de73cb0cd2bd5137b5a58c151bd83289

as well as: 3941bad0751fc2e59576d77bef531b0088571104
---
 spec/models/user_spec.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 08b5630b1e1..8269cc4b9f3 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -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)