summaryrefslogtreecommitdiff
path: root/spec/factories/projects.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-11-30 10:50:15 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-11-30 10:50:15 +0200
commit5c1496a4d803de6efe5c81b5d0a3bba7599bf81f (patch)
tree7aa90507a5cce1b3eaab7025fe814ca71773ef02 /spec/factories/projects.rb
parentf7d8467af94d6d4783419c8536275810de2bc19e (diff)
downloadgitlab-ce-5c1496a4d803de6efe5c81b5d0a3bba7599bf81f.tar.gz
Improve project factories
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/factories/projects.rb')
-rw-r--r--spec/factories/projects.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index 23314b3b1a4..60eb73e4a95 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -27,6 +27,10 @@
#
FactoryGirl.define do
+ # Project without repository
+ #
+ # Project does not have bare repository.
+ # Use this factory if you dont need repository in tests
factory :empty_project, class: 'Project' do
sequence(:name) { |n| "project#{n}" }
path { name.downcase.gsub(/\s/, '_') }
@@ -47,6 +51,20 @@ FactoryGirl.define do
end
end
+ # Project with empty repository
+ #
+ # This is a case when you just created a project
+ # but not pushed any code there yet
+ factory :project_empty_repo, parent: :empty_project do
+ after :create do |project|
+ project.create_repository
+ end
+ end
+
+ # Project with test repository
+ #
+ # Test repository source can be found at
+ # https://gitlab.com/gitlab-org/gitlab-test
factory :project, parent: :empty_project do
path { 'gitlabhq' }