diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-12-08 14:11:52 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-12-08 14:11:52 +0300 |
commit | 07b9b80a8833cf44ba804c9b8dfdf1550785fe83 (patch) | |
tree | 4bb39bfd0ca4c7255dc150b015c272be2e26aa72 /spec/factories/projects.rb | |
parent | 8384d0d8d528ffdd60c9ba9e3c0c9f688cb560ef (diff) |
Fix tests to use the new API
Diffstat (limited to 'spec/factories/projects.rb')
-rw-r--r-- | spec/factories/projects.rb | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index 1166498ddff..aa971e12a2e 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -91,8 +91,40 @@ FactoryGirl.define do factory :project, parent: :empty_project do path { 'gitlabhq' } - after :create do |project| + transient do + create_template nil + end + + after :create do |project, evaluator| TestEnv.copy_repo(project) + + if evaluator.create_template + args = evaluator.create_template + + project.add_user(args[:user], args[:access]) + + project.repository.commit_file( + args[:user], + ".gitlab/#{args[:path]}/bug.md", + 'something valid', + message: 'test 3', + branch_name: 'master', + update: false) + project.repository.commit_file( + args[:user], + ".gitlab/#{args[:path]}/template_test.md", + 'template_test', + message: 'test 1', + branch_name: 'master', + update: false) + project.repository.commit_file( + args[:user], + ".gitlab/#{args[:path]}/feature_proposal.md", + 'feature_proposal', + message: 'test 2', + branch_name: 'master', + update: false) + end end end |