FIX: Don't assume a clean slate in tests (#19499)
since plugins can have fixtures
This commit is contained in:
parent
d244eb0d7c
commit
97c5e19537
|
@ -445,6 +445,7 @@ RSpec.describe Group do
|
||||||
|
|
||||||
DB.exec("UPDATE groups SET user_count = 0 WHERE id = #{Group::AUTO_GROUPS[:trust_level_2]}")
|
DB.exec("UPDATE groups SET user_count = 0 WHERE id = #{Group::AUTO_GROUPS[:trust_level_2]}")
|
||||||
|
|
||||||
|
Group.delete_all
|
||||||
Group.refresh_automatic_groups!
|
Group.refresh_automatic_groups!
|
||||||
|
|
||||||
groups = Group.includes(:users).to_a
|
groups = Group.includes(:users).to_a
|
||||||
|
@ -964,6 +965,9 @@ RSpec.describe Group do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should return the right groups' do
|
it 'should return the right groups' do
|
||||||
|
Group.delete_all
|
||||||
|
Group.refresh_automatic_groups!
|
||||||
|
|
||||||
group_name = Fabricate(:group, name: 'tEsT_more_things', full_name: 'Abc something awesome').name
|
group_name = Fabricate(:group, name: 'tEsT_more_things', full_name: 'Abc something awesome').name
|
||||||
|
|
||||||
expect(search_group_names('te')).to eq([group_name])
|
expect(search_group_names('te')).to eq([group_name])
|
||||||
|
|
Loading…
Reference in New Issue