stablize spec
This commit is contained in:
parent
489c22d93c
commit
bf2955cd98
|
@ -42,7 +42,6 @@ describe DestroyTask do
|
||||||
let!(:g2) { Fabricate(:group) }
|
let!(:g2) { Fabricate(:group) }
|
||||||
|
|
||||||
it 'destroys all groups' do
|
it 'destroys all groups' do
|
||||||
before_count = Group.count
|
|
||||||
DestroyTask.destroy_groups
|
DestroyTask.destroy_groups
|
||||||
expect(Group.where(automatic: false).count).to eq 0
|
expect(Group.where(automatic: false).count).to eq 0
|
||||||
end
|
end
|
||||||
|
@ -55,14 +54,17 @@ describe DestroyTask do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'users' do
|
describe 'users' do
|
||||||
let!(:u) { Fabricate(:user) }
|
|
||||||
let!(:u2) { Fabricate(:user) }
|
|
||||||
let!(:a) { Fabricate(:admin) }
|
|
||||||
|
|
||||||
it 'destroys all non-admin users' do
|
it 'destroys all non-admin users' do
|
||||||
|
before_count = User.count
|
||||||
|
|
||||||
|
Fabricate(:user)
|
||||||
|
Fabricate(:user)
|
||||||
|
Fabricate(:admin)
|
||||||
|
|
||||||
DestroyTask.destroy_users
|
DestroyTask.destroy_users
|
||||||
expect(User.where(admin: false).count).to eq 0
|
expect(User.where(admin: false).count).to eq 0
|
||||||
expect(User.count).to eq 2 #system + 1 other admin
|
# admin does not get detroyed
|
||||||
|
expect(User.count).to eq before_count + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue