DEV: Change use of Redis flushall to flushdb.

FLUSHALL removes all keys from all databases. Instead we only want to
remove keys from the current Redis database.
This commit is contained in:
Guo Xiang Tan
2020-05-19 10:20:00 +08:00
parent f99f6ca111
commit 96c02caba7
15 changed files with 18 additions and 18 deletions

View File

@@ -508,7 +508,7 @@ describe PrettyText do
['apple', 'banana'].each { |w| Fabricate(:watched_word, word: w, action: WatchedWord.actions[:censor]) }
expect(PrettyText.cook("# banana")).not_to include('banana')
ensure
Discourse.redis.flushall
Discourse.redis.flushdb
end
end
end
@@ -1166,7 +1166,7 @@ HTML
end
describe "censoring" do
after(:all) { Discourse.redis.flushall }
after(:all) { Discourse.redis.flushdb }
def expect_cooked_match(raw, expected_cooked)
expect(PrettyText.cook(raw)).to eq(expected_cooked)