FIX: Reset state of `DiscourseRedis::FallbackHandler` in tests.

This commit is contained in:
Guo Xiang Tan 2016-04-18 10:41:40 +08:00
parent c5e0b74321
commit 36e3f1f5e4
No known key found for this signature in database
GPG Key ID: 19C321C8952B0F72
2 changed files with 11 additions and 0 deletions

View File

@ -64,6 +64,13 @@ class DiscourseRedis
end
end
# Used for testing
def reset!
@master = true
@last_checked = nil
@running = false
end
private
def synchronize

View File

@ -78,6 +78,10 @@ describe DiscourseRedis do
end
describe DiscourseRedis::FallbackHandler do
after do
fallback_handler.reset!
end
describe '#initiate_fallback_to_master' do
it 'should fallback to the master server once it is up' do
begin