summaryrefslogtreecommitdiff
path: root/spec/factories/projects.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-05-03 13:55:14 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-05-07 11:59:51 +0200
commit9a13059332a0c81b3a953f57bb9e40346eba951d (patch)
tree8f2806ec52b77cd212a19f9756c837606d988c62 /spec/factories/projects.rb
parent2d84de9ec90b87ee4e1e10ce1a4a9d00b07c39e7 (diff)
downloadgitlab-ce-9a13059332a0c81b3a953f57bb9e40346eba951d.tar.gz
Backports every CE related change from ee-5484 to CE
Diffstat (limited to 'spec/factories/projects.rb')
-rw-r--r--spec/factories/projects.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index a6128903546..a24ecec6c2e 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)