diff options
author | Drew Blessing <drew@gitlab.com> | 2015-12-18 01:08:14 +0300 |
---|---|---|
committer | Drew Blessing <drew@gitlab.com> | 2015-12-18 23:19:48 +0300 |
commit | f177aaa5fa789654dc440d6ec4ae3546544c1401 (patch) | |
tree | 709b259ea7903da9ac28e5393cc29d0780a6c63a /spec/helpers/merge_requests_helper_spec.rb | |
parent | 27859f7ed9e1efe98b8386844d0a7e69fd58277a (diff) |
Backport JIRA service
Diffstat (limited to 'spec/helpers/merge_requests_helper_spec.rb')
-rw-r--r-- | spec/helpers/merge_requests_helper_spec.rb | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/spec/helpers/merge_requests_helper_spec.rb b/spec/helpers/merge_requests_helper_spec.rb index 0ef1efb8bce..28fb3216f60 100644 --- a/spec/helpers/merge_requests_helper_spec.rb +++ b/spec/helpers/merge_requests_helper_spec.rb @@ -1,24 +1,37 @@ require 'spec_helper' describe MergeRequestsHelper do - describe "#issues_sentence" do + describe '#issues_sentence' do subject { issues_sentence(issues) } let(:issues) do [build(:issue, iid: 1), build(:issue, iid: 2), build(:issue, iid: 3)] end it { is_expected.to eq('#1, #2, and #3') } + + context 'for JIRA issues' do + let(:project) { create(:project) } + let(:issues) do + [ + JiraIssue.new('JIRA-123', project), + JiraIssue.new('JIRA-456', project), + JiraIssue.new('FOOBAR-7890', project) + ] + end + + it { is_expected.to eq('FOOBAR-7890, JIRA-123, and JIRA-456') } + end end - describe "#format_mr_branch_names" do - describe "within the same project" do + describe '#format_mr_branch_names' do + describe 'within the same project' do let(:merge_request) { create(:merge_request) } subject { format_mr_branch_names(merge_request) } it { is_expected.to eq([merge_request.source_branch, merge_request.target_branch]) } end - describe "within different projects" do + describe 'within different projects' do let(:project) { create(:project) } let(:fork_project) { create(:project, forked_from_project: project) } let(:merge_request) { create(:merge_request, source_project: fork_project, target_project: project) } |