summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-04-19 11:34:48 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-04-19 11:34:48 +0000
commit135fc81c347e3ad9596605c81a4d43341511dd78 (patch)
tree985e108fb95daa3c082a281b6e6f751dac714b65 /spec
parent8d0cae3f0a1e80a8c158c3720e71920b963569fe (diff)
parent6202aff3a01b2728d229535d6cb4cd34202b00e5 (diff)
downloadgitlab-ce-135fc81c347e3ad9596605c81a4d43341511dd78.tar.gz
Merge branch 'fix/user-count' into 'master'
Fix active user count See merge request !10783
Diffstat (limited to 'spec')
-rw-r--r--spec/models/user_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 9de16c41e94..6af5ef1018c 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -1631,4 +1631,16 @@ describe User, models: true do
end
end
end
+
+ context '.active' do
+ before do
+ User.ghost
+ create(:user, name: 'user', state: 'active')
+ create(:user, name: 'user', state: 'blocked')
+ end
+
+ it 'only counts active and non internal users' do
+ expect(User.active.count).to eq(1)
+ end
+ end
end