diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2017-05-04 08:09:21 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-05-04 08:09:21 +0000 |
commit | b64a37c4ed5561d423ee607f9821b75fd0337168 (patch) | |
tree | 7b10e0e1938f871a2a228fe38adf3641ef6f5ce5 /spec/models | |
parent | 8983ade27df200f7f9376d61de17f329d9d27a33 (diff) | |
download | gitlab-ce-b64a37c4ed5561d423ee607f9821b75fd0337168.tar.gz |
Allow to create new branch and empty WIP merge request from issue page
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/issue_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 11befd4edfe..8748b98a4e3 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -291,6 +291,27 @@ describe Issue, models: true do end end + describe '#has_related_branch?' do + let(:issue) { create(:issue, title: "Blue Bell Knoll") } + subject { issue.has_related_branch? } + + context 'branch found' do + before do + allow(issue.project.repository).to receive(:branch_names).and_return(["iceblink-luck", issue.to_branch_name]) + end + + it { is_expected.to eq true } + end + + context 'branch not found' do + before do + allow(issue.project.repository).to receive(:branch_names).and_return(["lazy-calm"]) + end + + it { is_expected.to eq false } + end + end + it_behaves_like 'an editable mentionable' do subject { create(:issue, project: create(:project, :repository)) } |