summaryrefslogtreecommitdiff
path: root/spec/factories/projects.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/projects.rb')
-rw-r--r--spec/factories/projects.rb106
1 files changed, 53 insertions, 53 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index ea89555b0d5..ae1feb73e4d 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -13,7 +13,7 @@ FactoryBot.define do
sequence(:name) { |n| "project#{n}" }
path { name.downcase.gsub(/\s/, '_') }
# Behaves differently to nil due to cache_has_external_issue_tracker
- has_external_issue_tracker false
+ has_external_issue_tracker { false }
# Associations
namespace
@@ -21,21 +21,21 @@ FactoryBot.define do
transient do
# Nest Project Feature attributes
- wiki_access_level ProjectFeature::ENABLED
- builds_access_level ProjectFeature::ENABLED
- snippets_access_level ProjectFeature::ENABLED
- issues_access_level ProjectFeature::ENABLED
- merge_requests_access_level ProjectFeature::ENABLED
- repository_access_level ProjectFeature::ENABLED
+ wiki_access_level { ProjectFeature::ENABLED }
+ builds_access_level { ProjectFeature::ENABLED }
+ snippets_access_level { ProjectFeature::ENABLED }
+ issues_access_level { ProjectFeature::ENABLED }
+ merge_requests_access_level { ProjectFeature::ENABLED }
+ repository_access_level { ProjectFeature::ENABLED }
pages_access_level do
visibility_level == Gitlab::VisibilityLevel::PUBLIC ? ProjectFeature::ENABLED : ProjectFeature::PRIVATE
end
# we can't assign the delegated `#ci_cd_settings` attributes directly, as the
# `#ci_cd_settings` relation needs to be created first
- group_runners_enabled nil
- import_status nil
- import_jid nil
+ group_runners_enabled { nil }
+ import_status { nil }
+ import_jid { nil }
end
after(:create) do |project, evaluator|
@@ -80,45 +80,45 @@ FactoryBot.define do
end
trait :public do
- visibility_level Gitlab::VisibilityLevel::PUBLIC
+ visibility_level { Gitlab::VisibilityLevel::PUBLIC }
end
trait :internal do
- visibility_level Gitlab::VisibilityLevel::INTERNAL
+ visibility_level { Gitlab::VisibilityLevel::INTERNAL }
end
trait :private do
- visibility_level Gitlab::VisibilityLevel::PRIVATE
+ visibility_level { Gitlab::VisibilityLevel::PRIVATE }
end
trait :import_scheduled do
- import_status :scheduled
+ import_status { :scheduled }
end
trait :import_started do
- import_status :started
+ import_status { :started }
end
trait :import_finished do
- import_status :finished
+ import_status { :finished }
end
trait :import_failed do
- import_status :failed
+ import_status { :failed }
end
trait :archived do
- archived true
+ archived { true }
end
- storage_version Project::LATEST_STORAGE_VERSION
+ storage_version { Project::LATEST_STORAGE_VERSION }
trait :legacy_storage do
- storage_version nil
+ storage_version { nil }
end
trait :access_requestable do
- request_access_enabled true
+ request_access_enabled { true }
end
trait :with_avatar do
@@ -146,7 +146,7 @@ FactoryBot.define do
# will create a repository containing two files, and two commits, in master
trait :custom_repo do
transient do
- files {}
+ files { {} }
end
after :create do |project, evaluator|
@@ -169,7 +169,7 @@ FactoryBot.define do
test_repo
transient do
- create_templates nil
+ create_templates { nil }
end
after :create do |project, evaluator|
@@ -206,9 +206,9 @@ FactoryBot.define do
trait :remote_mirror do
transient do
- remote_name "remote_mirror_#{SecureRandom.hex}"
- url "http://foo.com"
- enabled true
+ remote_name { "remote_mirror_#{SecureRandom.hex}" }
+ url { "http://foo.com" }
+ enabled { true }
end
after(:create) do |project, evaluator|
project.remote_mirrors.create!(url: evaluator.url, enabled: evaluator.enabled)
@@ -229,7 +229,7 @@ FactoryBot.define do
end
trait :read_only do
- repository_read_only true
+ repository_read_only { true }
end
trait :broken_repo do
@@ -249,29 +249,29 @@ FactoryBot.define do
end
end
- trait(:wiki_enabled) { wiki_access_level ProjectFeature::ENABLED }
- trait(:wiki_disabled) { wiki_access_level ProjectFeature::DISABLED }
- trait(:wiki_private) { wiki_access_level ProjectFeature::PRIVATE }
- trait(:builds_enabled) { builds_access_level ProjectFeature::ENABLED }
- trait(:builds_disabled) { builds_access_level ProjectFeature::DISABLED }
- trait(:builds_private) { builds_access_level ProjectFeature::PRIVATE }
- trait(:snippets_enabled) { snippets_access_level ProjectFeature::ENABLED }
- trait(:snippets_disabled) { snippets_access_level ProjectFeature::DISABLED }
- trait(:snippets_private) { snippets_access_level ProjectFeature::PRIVATE }
- trait(:issues_disabled) { issues_access_level ProjectFeature::DISABLED }
- trait(:issues_enabled) { issues_access_level ProjectFeature::ENABLED }
- trait(:issues_private) { issues_access_level ProjectFeature::PRIVATE }
- trait(:merge_requests_enabled) { merge_requests_access_level ProjectFeature::ENABLED }
- trait(:merge_requests_disabled) { merge_requests_access_level ProjectFeature::DISABLED }
- trait(:merge_requests_private) { merge_requests_access_level ProjectFeature::PRIVATE }
- trait(:merge_requests_public) { merge_requests_access_level ProjectFeature::PUBLIC }
- trait(:repository_enabled) { repository_access_level ProjectFeature::ENABLED }
- trait(:repository_disabled) { repository_access_level ProjectFeature::DISABLED }
- trait(:repository_private) { repository_access_level ProjectFeature::PRIVATE }
- trait(:pages_public) { pages_access_level ProjectFeature::PUBLIC }
- trait(:pages_enabled) { pages_access_level ProjectFeature::ENABLED }
- trait(:pages_disabled) { pages_access_level ProjectFeature::DISABLED }
- trait(:pages_private) { pages_access_level ProjectFeature::PRIVATE }
+ trait(:wiki_enabled) { wiki_access_level { ProjectFeature::ENABLED } }
+ trait(:wiki_disabled) { wiki_access_level { ProjectFeature::DISABLED } }
+ trait(:wiki_private) { wiki_access_level { ProjectFeature::PRIVATE } }
+ trait(:builds_enabled) { builds_access_level { ProjectFeature::ENABLED } }
+ trait(:builds_disabled) { builds_access_level { ProjectFeature::DISABLED } }
+ trait(:builds_private) { builds_access_level { ProjectFeature::PRIVATE } }
+ trait(:snippets_enabled) { snippets_access_level { ProjectFeature::ENABLED } }
+ trait(:snippets_disabled) { snippets_access_level { ProjectFeature::DISABLED } }
+ trait(:snippets_private) { snippets_access_level { ProjectFeature::PRIVATE } }
+ trait(:issues_disabled) { issues_access_level { ProjectFeature::DISABLED } }
+ trait(:issues_enabled) { issues_access_level { ProjectFeature::ENABLED } }
+ trait(:issues_private) { issues_access_level { ProjectFeature::PRIVATE } }
+ trait(:merge_requests_enabled) { merge_requests_access_level { ProjectFeature::ENABLED } }
+ trait(:merge_requests_disabled) { merge_requests_access_level { ProjectFeature::DISABLED } }
+ trait(:merge_requests_private) { merge_requests_access_level { ProjectFeature::PRIVATE } }
+ trait(:merge_requests_public) { merge_requests_access_level { ProjectFeature::PUBLIC } }
+ trait(:repository_enabled) { repository_access_level { ProjectFeature::ENABLED } }
+ trait(:repository_disabled) { repository_access_level { ProjectFeature::DISABLED } }
+ trait(:repository_private) { repository_access_level { ProjectFeature::PRIVATE } }
+ trait(:pages_public) { pages_access_level { ProjectFeature::PUBLIC } }
+ trait(:pages_enabled) { pages_access_level { ProjectFeature::ENABLED } }
+ trait(:pages_disabled) { pages_access_level { ProjectFeature::DISABLED } }
+ trait(:pages_private) { pages_access_level { ProjectFeature::PRIVATE } }
trait :auto_devops do
association :auto_devops, factory: :project_auto_devops
@@ -308,19 +308,19 @@ FactoryBot.define do
end
factory :redmine_project, parent: :project do
- has_external_issue_tracker true
+ has_external_issue_tracker { true }
redmine_service
end
factory :youtrack_project, parent: :project do
- has_external_issue_tracker true
+ has_external_issue_tracker { true }
youtrack_service
end
factory :jira_project, parent: :project do
- has_external_issue_tracker true
+ has_external_issue_tracker { true }
jira_service
end