mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:17:36 +08:00
DEV: Don't user before(:all)/after(:all) (#13389)
Leaking state and non-obvious order (before :all runs *before* RailsHelper.test_setup) are not worth it. A replacement PR for #13370. Fixes some flaky specs, e.g. ``` bin/rspec './spec/components/freedom_patches/translate_accelerator_spec.rb[1:3]' './spec/jobs/clean_up_user_export_topics_spec.rb[1:1]' --tag ~type:multisite --seed 35994 ``` Also included: * DEV: No need for locale reset (we do it anyway in rails_helper in `test_setup`)
This commit is contained in:
@ -1319,7 +1319,7 @@ HTML
|
||||
end
|
||||
|
||||
describe "censoring" do
|
||||
after(:all) { Discourse.redis.flushdb }
|
||||
after { Discourse.redis.flushdb }
|
||||
|
||||
def expect_cooked_match(raw, expected_cooked)
|
||||
expect(PrettyText.cook(raw)).to eq(expected_cooked)
|
||||
@ -1404,7 +1404,7 @@ HTML
|
||||
end
|
||||
|
||||
describe "watched words - replace & link" do
|
||||
after(:all) { Discourse.redis.flushdb }
|
||||
after { Discourse.redis.flushdb }
|
||||
|
||||
it "replaces words with other words" do
|
||||
Fabricate(:watched_word, action: WatchedWord.actions[:replace], word: "dolor sit*", replacement: "something else")
|
||||
|
Reference in New Issue
Block a user