don't risk being stuck in readonly

This commit is contained in:
Sam 2017-10-25 13:22:50 +11:00
parent 877b7be579
commit 7ca8853861

View File

@ -19,6 +19,11 @@ describe ApplicationRequest do
ApplicationRequest.last_flush = Time.now.utc
end
context "readonly test" do
after do
$redis.slaveof("no", "one")
end
it 'works even if redis is in readonly' do
disable_date_flush!
@ -34,6 +39,7 @@ describe ApplicationRequest do
inc(:http_total, autoflush: 3)
expect(ApplicationRequest.http_total.first.count).to eq(3)
end
end
it 'logs nothing for an unflushed increment' do
ApplicationRequest.increment!(:anon)