Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-05-07 18:15:57 +0300
committerDouwe Maan <douwe@gitlab.com>2018-05-07 18:15:57 +0300
commitd0cbef7e8f4faf76b9a528a4629517f29b8c265b (patch)
tree90610e3e78f17389bcd601f43b9fbe29723b6034 /spec/factories
parent32009764527a89708e89fb547ce4086e75cd04d0 (diff)
parent2a279143ebbccdbc180619cb29936d35d11b226d (diff)
Merge branch '42099-port-push-mirroring-to-ce-ce-port-v-2' into 'master'
CE backport of Backports Push Mirrors to CE Closes #42099 See merge request gitlab-org/gitlab-ce!18715
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/projects.rb11
-rw-r--r--spec/factories/remote_mirrors.rb6
2 files changed, 17 insertions, 0 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index 9ab57af1c60..d129815aeac 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -183,6 +183,17 @@ FactoryBot.define do
end
end
+ trait :remote_mirror do
+ transient do
+ 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)
+ end
+ end
+
trait :stubbed_repository do
after(:build) do |project|
allow(project).to receive(:empty_repo?).and_return(false)
diff --git a/spec/factories/remote_mirrors.rb b/spec/factories/remote_mirrors.rb
new file mode 100644
index 00000000000..adc7da27522
--- /dev/null
+++ b/spec/factories/remote_mirrors.rb
@@ -0,0 +1,6 @@
+FactoryBot.define do
+ factory :remote_mirror, class: 'RemoteMirror' do
+ association :project, :repository
+ url "http://foo:bar@test.com"
+ end
+end