DEV: Make all admins TL4 in tests (#25435)

Make admins TL4 by default in tests, foregoing the need to call refresh_auto_groups on them.
This commit is contained in:
Ted Johansson
2024-03-26 11:41:12 +08:00
committed by GitHub
parent d9179468e4
commit 5ee23fc394
17 changed files with 17 additions and 18 deletions

View File

@ -36,7 +36,7 @@ RSpec.describe TopicViewDetailsSerializer do
before { SiteSetting.can_permanently_delete = true }
it "is true for admins" do
admin = Fabricate(:admin, refresh_auto_groups: true)
admin = Fabricate(:admin)
serializer = described_class.new(TopicView.new(post.topic, admin), scope: Guardian.new(admin))
expect(serializer.as_json.dig(:topic_view_details, :can_permanently_delete)).to eq(true)

View File

@ -14,7 +14,7 @@ RSpec.describe TopicViewSerializer do
fab!(:topic)
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
fab!(:user_2) { Fabricate(:user) }
fab!(:admin) { Fabricate(:admin, refresh_auto_groups: true) }
fab!(:admin)
describe "#featured_link and #featured_link_root_domain" do
fab!(:featured_link) { "http://meta.discourse.org" }