Use `build` where possible in fabricators (#25360)
parent
c94bb9ba9a
commit
3a2a15c6ea
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:account_domain_block) do
|
||||
account
|
||||
account { Fabricate.build(:account) }
|
||||
domain 'example.com'
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:account_note) do
|
||||
account
|
||||
target_account { Fabricate(:account) }
|
||||
account { Fabricate.build(:account) }
|
||||
target_account { Fabricate.build(:account) }
|
||||
comment 'User note text'
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:account_statuses_cleanup_policy) do
|
||||
account
|
||||
account { Fabricate.build(:account) }
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator('Admin::ActionLog') do
|
||||
account
|
||||
account { Fabricate.build(:account) }
|
||||
action 'MyString'
|
||||
target nil
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:backup) do
|
||||
user
|
||||
user { Fabricate.build(:user) }
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:block) do
|
||||
account
|
||||
target_account { Fabricate(:account) }
|
||||
account { Fabricate.build(:account) }
|
||||
target_account { Fabricate.build(:account) }
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:bookmark) do
|
||||
account
|
||||
status
|
||||
account { Fabricate.build(:account) }
|
||||
status { Fabricate.build(:status) }
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:bulk_import_row) do
|
||||
bulk_import
|
||||
bulk_import { Fabricate.build(:bulk_import) }
|
||||
data ''
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:custom_filter_keyword) do
|
||||
custom_filter
|
||||
custom_filter { Fabricate.build(:custom_filter) }
|
||||
keyword 'discourse'
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:custom_filter_status) do
|
||||
custom_filter
|
||||
status
|
||||
custom_filter { Fabricate.build(:custom_filter) }
|
||||
status { Fabricate.build(:status) }
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:encrypted_message) do
|
||||
device
|
||||
from_account { Fabricate(:account) }
|
||||
device { Fabricate.build(:device) }
|
||||
from_account { Fabricate.build(:account) }
|
||||
from_device_id { Faker::Number.number(digits: 5) }
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:favourite) do
|
||||
account
|
||||
status
|
||||
account { Fabricate.build(:account) }
|
||||
status { Fabricate.build(:status) }
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:featured_tag) do
|
||||
account
|
||||
tag
|
||||
account { Fabricate.build(:account) }
|
||||
tag { Fabricate.build(:tag) }
|
||||
name { sequence(:name) { |i| "Tag#{i}" } }
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:follow) do
|
||||
account
|
||||
target_account { Fabricate(:account) }
|
||||
account { Fabricate.build(:account) }
|
||||
target_account { Fabricate.build(:account) }
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:follow_request) do
|
||||
account
|
||||
target_account { Fabricate(:account, locked: true) }
|
||||
account { Fabricate.build(:account) }
|
||||
target_account { Fabricate.build(:account, locked: true) }
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:identity) do
|
||||
user
|
||||
user { Fabricate.build(:user) }
|
||||
provider 'MyString'
|
||||
uid 'MyString'
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:list) do
|
||||
account
|
||||
account { Fabricate.build(:account) }
|
||||
title 'MyString'
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:mention) do
|
||||
account
|
||||
status
|
||||
account { Fabricate.build(:account) }
|
||||
status { Fabricate.build(:status) }
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:mute) do
|
||||
account
|
||||
target_account { Fabricate(:account) }
|
||||
account { Fabricate.build(:account) }
|
||||
target_account { Fabricate.build(:account) }
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:poll_vote) do
|
||||
account
|
||||
account { Fabricate.build(:account) }
|
||||
poll
|
||||
choice 0
|
||||
end
|
||||
|
@ -1,8 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:report) do
|
||||
account
|
||||
target_account { Fabricate(:account) }
|
||||
account { Fabricate.build(:account) }
|
||||
target_account { Fabricate.build(:account) }
|
||||
comment 'You nasty'
|
||||
action_taken_at nil
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:report_note) do
|
||||
report
|
||||
account { Fabricate(:account) }
|
||||
report { Fabricate.build(:report) }
|
||||
account { Fabricate.build(:account) }
|
||||
content 'Test Content'
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:scheduled_status) do
|
||||
account
|
||||
account { Fabricate.build(:account) }
|
||||
scheduled_at { 20.hours.from_now }
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:session_activation) do
|
||||
user
|
||||
user { Fabricate.build(:user) }
|
||||
session_id 'MyString'
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:status_pin) do
|
||||
account
|
||||
status { |attrs| Fabricate(:status, account: attrs[:account], visibility: :public) }
|
||||
account { Fabricate.build(:account) }
|
||||
status { |attrs| Fabricate.build(:status, account: attrs[:account], visibility: :public) }
|
||||
end
|
||||
|
Loading…
Reference in new issue