No need for special helper to reset SiteSetting state.

* SiteSetting in tests uses a local provider that resets it.
This commit is contained in:
Guo Xiang Tan
2017-01-28 10:55:49 +08:00
parent 7ead3e1f18
commit 0e5d490b05
4 changed files with 13 additions and 26 deletions

View File

@@ -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