mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
PERF: Redis snapshotting during tests (#15260)
We can fake redis transactions so that `fab!` works for redis and PG data, but it's too slow to be used indiscriminately. Instead, you can opt into it with the `use_redis_snapshotting` helper. Insofar as snapshotting allows us to `fab!` more things, it provides a speedup.
This commit is contained in:

committed by
GitHub

parent
e42f33b6ba
commit
02245ce41f
@ -1756,11 +1756,13 @@ RSpec.describe TopicsController do
|
||||
end
|
||||
|
||||
describe '#show' do
|
||||
fab!(:private_topic) { Fabricate(:private_message_topic) }
|
||||
let!(:topic) { Fabricate(:post).topic }
|
||||
use_redis_snapshotting
|
||||
|
||||
let!(:p1) { Fabricate(:post, user: topic.user) }
|
||||
let!(:p2) { Fabricate(:post, user: topic.user) }
|
||||
fab!(:private_topic) { Fabricate(:private_message_topic) }
|
||||
fab!(:topic) { Fabricate(:post).topic }
|
||||
|
||||
fab!(:p1) { Fabricate(:post, user: topic.user) }
|
||||
fab!(:p2) { Fabricate(:post, user: topic.user) }
|
||||
|
||||
describe 'when topic is not allowed' do
|
||||
it 'should return the right response' do
|
||||
|
Reference in New Issue
Block a user