mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 12:02:05 +08:00
PERF: Make tests faster by prefabricating more things (#15370)
This commit is contained in:

committed by
GitHub

parent
973c9bdcd3
commit
7e0c1fb039
@ -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) }
|
||||
|
Reference in New Issue
Block a user