Enable Style/FrozenStringLiteralComment for specs (#23790)

This commit is contained in:
Nick Schonning 2023-02-21 19:55:31 -05:00 committed by GitHub
parent 0cfdd1a401
commit 84cc805cae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
369 changed files with 738 additions and 0 deletions

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator :access_grant, from: 'Doorkeeper::AccessGrant' do
application
resource_owner_id { Fabricate(:user).id }

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
Fabricator :access_token, from: 'Doorkeeper::AccessToken' do
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator :accessible_access_token, from: :access_token do
expires_in { nil }
revoked_at { nil }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:account_alias) do
account
acct 'test@example.com'

View file

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

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:account_domain_block) do
account
domain 'example.com'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
keypair = OpenSSL::PKey::RSA.new(2048)
public_key = keypair.public_key.to_pem
private_key = keypair.to_pem

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:account_migration) do
account
target_account { |attrs| Fabricate(:account, also_known_as: [ActivityPub::TagManager.instance.uri_for(attrs[:account])]) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:account_moderation_note) do
content 'MyText'
account nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:account_note) do
account
target_account { Fabricate(:account) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:account_pin) do
account nil
target_account nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:account_stat) do
account nil
statuses_count ''

View file

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

View file

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

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:account_warning) do
account
target_account(fabricator: :account)

View file

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

View file

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

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:announcement) do
text { Faker::Lorem.paragraph(sentence_count: 2) }
published true

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:announcement_mute) do
account
announcement

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:announcement_reaction) do
account
announcement

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:appeal) do
strike(fabricator: :account_warning)
account { |attrs| attrs[:strike].target_account }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:application, from: Doorkeeper::Application) do
name 'Example'
website 'http://example.com'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:backup) do
user
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:block) do
account
target_account { Fabricate(:account) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:bookmark) do
account
status

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:canonical_email_block) do
email 'test@example.com'
reference_account { Fabricate(:account) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:conversation_account) do
account nil
conversation nil

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
Fabricator(:conversation) do
end

View file

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

View file

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

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:custom_emoji) do
shortcode 'coolcat'
domain nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:custom_filter) do
account
expires_at nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:custom_filter_keyword) do
custom_filter
keyword 'discourse'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:custom_filter_status) do
custom_filter
status

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:device) do
access_token
account

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:domain_allow) do
domain 'MyString'
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:domain_block) do
domain { sequence(:domain) { |i| "#{i}#{Faker::Internet.domain_name}" } }
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:email_domain_block) do
domain { sequence(:domain) { |i| "#{i}#{Faker::Internet.domain_name}" } }
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:encrypted_message) do
device
from_account

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:favourite) do
account
status

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:featured_tag) do
account
tag

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:follow) do
account
target_account { Fabricate(:account) }

View file

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

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:follow_request) do
account
target_account { Fabricate(:account, locked: true) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:identity) do
user nil
provider 'MyString'

View file

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

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:invite) do
user
expires_at nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:ip_block) do
ip ''
severity ''

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:list_account) do
list nil
account nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:list) do
account
title 'MyString'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:login_activity) do
user
authentication_method 'password'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:marker) do
user
timeline 'home'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:media_attachment) do
account

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:mention) do
account
status

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:mute) do
account
target_account { Fabricate(:account) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:notification) do
activity fabricator: [:mention, :status, :follow, :follow_request, :favourite].sample
account

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:one_time_key) do
device
key_id { Faker::Alphanumeric.alphanumeric(number: 10) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:poll) do
account
status

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:poll_vote) do
account
poll

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:preview_card) do
url { Faker::Internet.url }
title { Faker::Lorem.sentence }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:relay) do
inbox_url 'https://example.com/inbox'
state :idle

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:report) do
account
target_account { Fabricate(:account) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:report_note) do
report
account { Fabricate(:account) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:rule) do
priority 0
deleted_at nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:scheduled_status) do
account
scheduled_at { 20.hours.from_now }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:session_activation) do
user
session_id 'MyString'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:site_upload) do
file { File.open(File.join(Rails.root, 'spec', 'fabricators', 'assets', 'utah_teapot.png')) }
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:status_edit) do
status nil
account nil

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:status) do
account
text 'Lorem ipsum dolor sit amet'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:status_pin) do
account
status { |attrs| Fabricate(:status, account: attrs[:account], visibility: :public) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:status_stat) do
status_id nil
replies_count ''

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
Fabricator(:system_key) do
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:tag) do
name { sequence(:hashtag) { |i| "#{Faker::Lorem.word}#{i}" } }
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:tag_follow) do
tag
account

View file

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

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:user) do
account { Fabricate.build(:account, user: nil) }
email { sequence(:email) { |i| "#{i}#{Faker::Internet.email}" } }

View file

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

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:user_role) do
name 'MyString'
color ''

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:web_push_subscription, from: Web::PushSubscription) do
endpoint Faker::Internet.url
key_p256dh Faker::Internet.password

View file

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

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:webauthn_credential) do
user_id { Fabricate(:user).id }
external_id { Base64.urlsafe_encode64(SecureRandom.random_bytes(16)) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Fabricator(:webhook) do
url { Faker::Internet.url }
secret { SecureRandom.hex }