FIX: clear WordWatcher cache after topic_spec (#11488)

Forbidden words are cached and should be purged after spec if finished
This commit is contained in:
Krzysztof Kotlarek 2020-12-15 09:48:27 +11:00 committed by GitHub
parent e02c47c4f3
commit 86a8070fd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -37,6 +37,10 @@ describe Topic do
end
describe 'when title contains censored words' do
after do
WordWatcher.clear_cache!
end
it 'should not be valid' do
['pineapple', 'pen'].each { |w| Fabricate(:watched_word, word: w, action: WatchedWord.actions[:censor]) }
@ -88,6 +92,10 @@ describe Topic do
describe 'blocked words' do
describe 'when title contains watched words' do
after do
WordWatcher.clear_cache!
end
it 'should not be valid' do
Fabricate(:watched_word, word: 'pineapple', action: WatchedWord.actions[:block])