summaryrefslogtreecommitdiff
path: root/spec/factories
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-06-16 08:27:37 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-06-16 08:27:37 +0530
commit90bba2bc4637a059e17415a64b25776a6ab1b4bf (patch)
treeb20af89e750a3fa8e976b78373a6567c2785148d /spec/factories
parent7ee0898a9ec4a03c9a55841b1cbea67add460c50 (diff)
parente507a84c3398e9869484dcc2c90d6c0dbdc5bbe2 (diff)
downloadgitlab-ce-90bba2bc4637a059e17415a64b25776a6ab1b4bf.tar.gz
Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/deployments.rb13
-rw-r--r--spec/factories/environments.rb7
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/factories/deployments.rb b/spec/factories/deployments.rb
new file mode 100644
index 00000000000..82591604fcb
--- /dev/null
+++ b/spec/factories/deployments.rb
@@ -0,0 +1,13 @@
+FactoryGirl.define do
+ factory :deployment, class: Deployment do
+ sha '97de212e80737a608d939f648d959671fb0a0142'
+ ref 'master'
+ tag false
+
+ environment factory: :environment
+
+ after(:build) do |deployment, evaluator|
+ deployment.project = deployment.environment.project
+ end
+ end
+end
diff --git a/spec/factories/environments.rb b/spec/factories/environments.rb
new file mode 100644
index 00000000000..07265c26ca3
--- /dev/null
+++ b/spec/factories/environments.rb
@@ -0,0 +1,7 @@
+FactoryGirl.define do
+ factory :environment, class: Environment do
+ sequence(:name) { |n| "environment#{n}" }
+
+ project factory: :empty_project
+ end
+end