0
0
Fork 0

Fabricator specs (#23925)

This commit is contained in:
Matt Jankowski 2023-03-04 11:12:09 -05:00 committed by GitHub
parent c40d5e5a8f
commit cd99fa8ceb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 27 additions and 183 deletions

View file

@ -1,7 +0,0 @@
# frozen_string_literal: true
Fabricator(:account_alias) do
account
acct 'test@example.com'
uri 'https://example.com/users/test'
end

View file

@ -1,5 +0,0 @@
# frozen_string_literal: true
Fabricator(:account_deletion_request) do
account
end

View file

@ -5,4 +5,5 @@ Fabricator(:account_migration) do
target_account { |attrs| Fabricate(:account, also_known_as: [ActivityPub::TagManager.instance.uri_for(attrs[:account])]) }
acct { |attrs| attrs[:target_account].acct }
followers_count 1234
created_at { 60.days.ago }
end

View file

@ -2,5 +2,6 @@
Fabricator(:account_moderation_note) do
content 'MyText'
account nil
account
target_account { Fabricate(:account) }
end

View file

@ -1,6 +1,7 @@
# frozen_string_literal: true
Fabricator(:account_pin) do
account nil
target_account nil
account
target_account(fabricator: :account)
before_create { |account_pin, _| account_pin.account.follow!(account_pin.target_account) }
end

View file

@ -1,8 +1,8 @@
# frozen_string_literal: true
Fabricator(:account_stat) do
account nil
statuses_count ''
following_count ''
followers_count ''
account
statuses_count '123'
following_count '456'
followers_count '789'
end

View file

@ -1,5 +0,0 @@
# frozen_string_literal: true
Fabricator(:account_tag_stat) do
accounts_count ''
end

View file

@ -1,5 +0,0 @@
# frozen_string_literal: true
Fabricator(:account_warning_preset) do
text 'MyText'
end

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
Fabricator('Admin::ActionLog') do
account nil
account
action 'MyString'
target nil
end

View file

@ -1,6 +0,0 @@
# frozen_string_literal: true
Fabricator(:announcement_mute) do
account
announcement
end

View file

@ -1,7 +0,0 @@
# frozen_string_literal: true
Fabricator(:announcement_reaction) do
account
announcement
name '🌿'
end

View file

@ -1,8 +0,0 @@
# frozen_string_literal: true
Fabricator(:conversation_account) do
account nil
conversation nil
participant_account_ids ''
last_status nil
end

View file

@ -1,4 +0,0 @@
# frozen_string_literal: true
Fabricator(:conversation_mute) do
end

View file

@ -1,5 +0,0 @@
# frozen_string_literal: true
Fabricator(:custom_emoji_category) do
name 'MyString'
end

View file

@ -1,10 +0,0 @@
# frozen_string_literal: true
Fabricator(:encrypted_message) do
device
from_account
from_device_id { Faker::Number.number(digits: 5) }
type 0
body ''
message_franking ''
end

View file

@ -1,8 +0,0 @@
# frozen_string_literal: true
Fabricator(:featured_tag) do
account
tag
statuses_count 1_337
last_status_at Time.now.utc
end

View file

@ -1,5 +0,0 @@
# frozen_string_literal: true
Fabricator(:follow_recommendation_suppression) do
account
end

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
Fabricator(:identity) do
user nil
user
provider 'MyString'
uid 'MyString'
end

View file

@ -1,4 +0,0 @@
# frozen_string_literal: true
Fabricator(:import) do
end

View file

@ -1,8 +0,0 @@
# frozen_string_literal: true
Fabricator(:ip_block) do
ip ''
severity ''
expires_at '2020-10-08 22:20:37'
comment 'MyText'
end

View file

@ -1,7 +0,0 @@
# frozen_string_literal: true
Fabricator(:list_account) do
list nil
account nil
follow nil
end

View file

@ -1,13 +0,0 @@
# frozen_string_literal: true
Fabricator(:one_time_key) do
device
key_id { Faker::Alphanumeric.alphanumeric(number: 10) }
key { Base64.strict_encode64(Ed25519::SigningKey.generate.verify_key.to_bytes) }
signature do |attrs|
signing_key = Ed25519::SigningKey.generate
attrs[:device].update(fingerprint_key: Base64.strict_encode64(signing_key.verify_key.to_bytes))
Base64.strict_encode64(signing_key.sign(attrs[:key]))
end
end

View file

@ -1,4 +1,5 @@
# frozen_string_literal: true
Fabricator(:setting) do
var 'var'
end

View file

@ -2,4 +2,5 @@
Fabricator(:site_upload) do
file { Rails.root.join('spec', 'fabricators', 'assets', 'utah_teapot.png').open }
var 'thumbnail'
end

View file

@ -1,9 +0,0 @@
# frozen_string_literal: true
Fabricator(:status_edit) do
status nil
account nil
text 'MyText'
spoiler_text 'MyText'
media_attachments_changed false
end

View file

@ -1,8 +0,0 @@
# frozen_string_literal: true
Fabricator(:status_stat) do
status_id nil
replies_count ''
reblogs_count ''
favourites_count ''
end

View file

@ -1,5 +1,5 @@
# frozen_string_literal: true
Fabricator(:unavailable_domain) do
domain { Faker::Internet.domain }
domain { Faker::Internet.domain_name }
end

View file

@ -1,6 +0,0 @@
# frozen_string_literal: true
Fabricator(:user_invite_request) do
user
text { Faker::Lorem.sentence }
end

View file

@ -1,4 +0,0 @@
# frozen_string_literal: true
Fabricator(:web_setting, from: Web::Setting) do
end