mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
No need for special helper to reset SiteSetting state.
* SiteSetting in tests uses a local provider that resets it.
This commit is contained in:
@@ -15,9 +15,9 @@ describe Topic do
|
||||
|
||||
describe 'censored words' do
|
||||
describe 'when title contains censored words' do
|
||||
site_setting(:censored_words, 'pineapple|pen')
|
||||
|
||||
it 'should not be valid' do
|
||||
SiteSetting.censored_words = 'pineapple|pen'
|
||||
|
||||
topic.title = 'pen PinEapple apple pen '
|
||||
|
||||
expect(topic).to_not be_valid
|
||||
@@ -29,9 +29,9 @@ describe Topic do
|
||||
end
|
||||
|
||||
describe 'when title matches censored pattern' do
|
||||
site_setting(:censored_pattern, 'orange.*')
|
||||
|
||||
it 'should not be valid' do
|
||||
SiteSetting.censored_pattern = 'orange.*'
|
||||
|
||||
topic.title = 'I have orangEjuice orange monkey orange stuff'
|
||||
|
||||
expect(topic).to_not be_valid
|
||||
|
||||
Reference in New Issue
Block a user