PERF: Make tests faster by prefabricating more things (#15370)

This commit is contained in:
Daniel Waterworth
2021-12-20 12:59:10 -06:00
committed by GitHub
parent 973c9bdcd3
commit 7e0c1fb039
7 changed files with 102 additions and 145 deletions

View File

@ -5,11 +5,15 @@ require 'topic_view'
describe TopicQuery do
# TODO: this let! here has impact on all tests
# it indeed happens first, but is not obvious later in the tests we depend on the user being
# created so early otherwise finding new topics does not work
# we should remove the let! here and use freeze time to communicate how the clock moves
let!(:user) { Fabricate(:user) }
# TODO:
# This fab! here has impact on all tests.
#
# It happens first, but is not obvious later in the tests that we depend on
# the user being created so early otherwise finding new topics does not
# work.
#
# We should use be more explicit in communicating how the clock moves
fab!(:user) { Fabricate(:user) }
fab!(:creator) { Fabricate(:user) }
let(:topic_query) { TopicQuery.new(user) }