Commit e5699ae1 authored by Luke Duncalfe's avatar Luke Duncalfe Committed by Bob Van Landuyt

Optimise WikiPage spec

Locally the spec has reduced from ~45s to ~14s.

We used to spend ~35s creating 416 factories, and we now spend ~3s
creating 43 factories.
parent a9dc7769
......@@ -106,7 +106,7 @@ class Wiki
[WikiDirectory.group_pages(pages), limited]
end
# Finds a page within the repository based on a tile
# Finds a page within the repository based on a title
# or slug.
#
# title - The human readable or parameterized title of
......
......@@ -4,7 +4,7 @@ FactoryBot.define do
factory :wiki do
transient do
container { association(:project) }
user { association(:user) }
user { container.default_owner || association(:user) }
end
initialize_with { Wiki.for_container(container, user) }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment