Add frozen_string_literal to spec/factories

Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
This commit is contained in:
Thong Kuah 2019-07-25 17:11:48 +12:00
parent 9e91ae15a8
commit 94bb660460
118 changed files with 236 additions and 0 deletions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :abuse_report do
reporter factory: :user

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Read about factories at https://github.com/thoughtbot/factory_bot
FactoryBot.define do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :application_setting do
default_projects_limit 42

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :award_emoji do
name "thumbsup"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
trait :base_badge do
link_url { generate(:url) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :board do
transient do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :broadcast_message do
message "MyText"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :chat_name, class: ChatName do
user factory: :user

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :chat_team, class: ChatTeam do
sequence(:team_id) { |n| "abcdefghijklm#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_bridge, class: Ci::Bridge do
name 'bridge'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_build_trace_chunk, class: Ci::BuildTraceChunk do
build factory: :ci_build

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_build_trace_section_name, class: Ci::BuildTraceSectionName do
sequence(:name) { |n| "section_#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
include ActionDispatch::TestProcess
FactoryBot.define do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_group_variable, class: Ci::GroupVariable do
sequence(:key) { |n| "VARIABLE_#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
include ActionDispatch::TestProcess
FactoryBot.define do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_pipeline_schedule, class: Ci::PipelineSchedule do
cron '0 1 * * *'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_pipeline_schedule_variable, class: Ci::PipelineScheduleVariable do
sequence(:key) { |n| "VARIABLE_#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_pipeline_variable, class: Ci::PipelineVariable do
sequence(:key) { |n| "VARIABLE_#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_empty_pipeline, class: Ci::Pipeline do
source :push

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_runner_project, class: Ci::RunnerProject do
runner factory: [:ci_runner, :project]

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_runner, class: Ci::Runner do
sequence(:description) { |n| "My runner#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_stage, class: Ci::LegacyStage do
skip_create

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_trigger_request, class: Ci::TriggerRequest do
trigger factory: :ci_trigger

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_trigger_without_token, class: Ci::Trigger do
owner

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :ci_variable, class: Ci::Variable do
sequence(:key) { |n| "VARIABLE_#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :clusters_applications_helm, class: Clusters::Applications::Helm do
cluster factory: %i(cluster provided_by_gcp)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :cluster, class: Clusters::Cluster do
user

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :cluster_platform_kubernetes, class: Clusters::Platforms::Kubernetes do
cluster

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :cluster_provider_gcp, class: Clusters::Providers::Gcp do
cluster

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :commit_status, class: CommitStatus do
name 'default'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../support/helpers/repo_helpers'
FactoryBot.define do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :container_repository do
name 'test_image'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :conversational_development_index_metric, class: ConversationalDevelopmentIndex::Metric do
leader_issues 9.256

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :deploy_keys_project do
deploy_key

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :deploy_token do
token { SecureRandom.hex(50) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :deployment, class: Deployment do
sha 'b83d6e391c22777fca1ed3012fce84f633d7fed0'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :email do
user

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :environment, class: Environment do
sequence(:name) { |n| "environment#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :event do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :file_uploader do
skip_create

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :fork_network_member do
association :project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :fork_network do
association :root_project, factory: :project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
sequence(:gitaly_commit_id) { Digest::SHA1.hexdigest(Time.now.to_f.to_s) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :gitaly_commit_author, class: Gitaly::CommitAuthor do
skip_create

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :gitaly_tag, class: Gitaly::Tag do
skip_create

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :gpg_key_subkey do
gpg_key

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../support/helpers/gpg_helpers'
FactoryBot.define do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :gpg_signature do
commit_sha { Digest::SHA1.hexdigest(SecureRandom.hex) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :group_custom_attribute do
group

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :group_member do
access_level { GroupMember::OWNER }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :group, class: Group, parent: :namespace do
sequence(:name) { |n| "group#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :identity do
provider 'ldapmain'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :import_export_upload do
project { create(:project) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :import_state, class: ProjectImportState do
status :none

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :instance_configuration do
skip_create

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :internal_id do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :issue do
title { generate(:title) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../support/helpers/key_generator_helper'
FactoryBot.define do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :label_link do
label

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :label_priority do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
trait :base_label do
title { generate(:label_title) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :lfs_file_lock do
user

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
include ActionDispatch::TestProcess
FactoryBot.define do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :lfs_objects_project do
lfs_object

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :list do
board

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :merge_request do
title { generate(:title) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :merge_requests_closing_issues do
issue

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :milestone do
title

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :namespace do
sequence(:name) { |n| "namespace#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../support/helpers/repo_helpers'
include ActionDispatch::TestProcess

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :notification_setting do
source factory: :project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :oauth_access_grant do
resource_owner_id { create(:user).id }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :oauth_access_token do
resource_owner

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :oauth_application, class: 'Doorkeeper::Application', aliases: [:application] do
sequence(:name) { |n| "OAuth App #{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :pages_domain, class: 'PagesDomain' do
sequence(:domain) { |n| "my#{n}.domain.com" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :personal_access_token do
user

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :pool_repository do
shard { Shard.by_name("default") }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :programming_language do
name 'Ruby'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :project_auto_devops do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :project_custom_attribute do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :project_deploy_token do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :project_group_link do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :project_hook do
url { generate(:url) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :project_member do
user

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :project_statistics do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :project_wiki do
skip_create

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require_relative '../support/helpers/test_env'
FactoryBot.define do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :protected_branch do
name

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :protected_tag do
name

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :redirect_route do
sequence(:path) { |n| "redirect#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :release do
tag "v1.1.0"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :remote_mirror, class: 'RemoteMirror' do
association :project, :repository

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :repository_language do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :sent_notification do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
sequence(:username) { |n| "user#{n}" }
sequence(:name) { |n| "John Doe#{n}" }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :service_hook do
url { generate(:url) }

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :service do
project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :shard do
name "default"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :snippet do
author

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
FactoryBot.define do
factory :spam_log do
user

Some files were not shown because too many files have changed in this diff Show More