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/lib/gitlab/template | |
parent | 8384d0d8d528ffdd60c9ba9e3c0c9f688cb560ef (diff) |
Fix tests to use the new API
Diffstat (limited to 'spec/lib/gitlab/template')
-rw-r--r-- | spec/lib/gitlab/template/issue_template_spec.rb | 19 | ||||
-rw-r--r-- | spec/lib/gitlab/template/merge_request_template_spec.rb | 19 |
2 files changed, 18 insertions, 20 deletions
diff --git a/spec/lib/gitlab/template/issue_template_spec.rb b/spec/lib/gitlab/template/issue_template_spec.rb index d2d334e6413..984236b74ce 100644 --- a/spec/lib/gitlab/template/issue_template_spec.rb +++ b/spec/lib/gitlab/template/issue_template_spec.rb @@ -4,16 +4,15 @@ describe Gitlab::Template::IssueTemplate do subject { described_class } let(:user) { create(:user) } - let(:project) { create(:project) } - let(:file_path_1) { '.gitlab/issue_templates/bug.md' } - let(:file_path_2) { '.gitlab/issue_templates/template_test.md' } - let(:file_path_3) { '.gitlab/issue_templates/feature_proposal.md' } - - before do - project.add_user(user, Gitlab::Access::MASTER) - project.repository.commit_file(user, file_path_1, "something valid", "test 3", "master", false) - project.repository.commit_file(user, file_path_2, "template_test", "test 1", "master", false) - project.repository.commit_file(user, file_path_3, "feature_proposal", "test 2", "master", false) + + let(:project) do + create(:project, + create_template: { + user: user, + access: Gitlab::Access::MASTER, + path: 'issue_templates' + } + ) end describe '.all' do diff --git a/spec/lib/gitlab/template/merge_request_template_spec.rb b/spec/lib/gitlab/template/merge_request_template_spec.rb index ddf68c4cf78..e98a8beccdd 100644 --- a/spec/lib/gitlab/template/merge_request_template_spec.rb +++ b/spec/lib/gitlab/template/merge_request_template_spec.rb @@ -4,16 +4,15 @@ describe Gitlab::Template::MergeRequestTemplate do subject { described_class } let(:user) { create(:user) } - let(:project) { create(:project) } - let(:file_path_1) { '.gitlab/merge_request_templates/bug.md' } - let(:file_path_2) { '.gitlab/merge_request_templates/template_test.md' } - let(:file_path_3) { '.gitlab/merge_request_templates/feature_proposal.md' } - - before do - project.add_user(user, Gitlab::Access::MASTER) - project.repository.commit_file(user, file_path_1, "something valid", "test 3", "master", false) - project.repository.commit_file(user, file_path_2, "template_test", "test 1", "master", false) - project.repository.commit_file(user, file_path_3, "feature_proposal", "test 2", "master", false) + + let(:project) do + create(:project, + create_template: { + user: user, + access: Gitlab::Access::MASTER, + path: 'merge_request_templates' + } + ) end describe '.all' do |