DEV: Fix extremely rare test failure

If this was the first test to run, the Fabricate(:user) would be given
the same ID as the Fabricate.build(:user, id: 1). This works around it.
This commit is contained in:
David Taylor 2018-12-06 13:32:56 +00:00
parent 7ec124fc89
commit e8f32dd3ba
1 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,9 @@ describe UserGuardian do
end
context "hidden profile" do
# Mixing Fabricate.build() and Fabricate() could cause ID clashes, so override :user
let(:user) { Fabricate(:user) }
let(:hidden_user) do
result = Fabricate(:user)
result.user_option.update_column(:hide_profile_and_presence, true)