summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRydkin Maxim <maks.rydkin@gmail.com>2016-12-04 00:45:48 +0300
committerRydkin Maxim <maks.rydkin@gmail.com>2016-12-08 01:06:23 +0300
commit0a8289cafd4a996452c0e21322178793be8120be (patch)
treea63cd01bdef0c628413e1b887a05e1b2fe3cd81b /spec
parente7b045eadaf315dc2ae4fc079af5d1199d3e5d25 (diff)
downloadgitlab-ce-0a8289cafd4a996452c0e21322178793be8120be.tar.gz
add link_to_if helper on target_branch link on Merge Request show page for case of deleted target branch
add spec on #24507 bug description add changelog entry fix changelog remove unnecessary js:true from specs change spec title add test for link to target branch before deletions renamed spec about state of target branch link before and after deletion some fixes into spec
Diffstat (limited to 'spec')
-rw-r--r--spec/features/merge_requests/target_branch_spec.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/features/merge_requests/target_branch_spec.rb b/spec/features/merge_requests/target_branch_spec.rb
new file mode 100644
index 00000000000..b6134540273
--- /dev/null
+++ b/spec/features/merge_requests/target_branch_spec.rb
@@ -0,0 +1,41 @@
+require 'spec_helper'
+
+describe 'Target branch', feature: true do
+ let(:user) { create(:user) }
+ let(:merge_request) { create(:merge_request) }
+ let(:project) { merge_request.project }
+
+ def path_to_merge_request
+ namespace_project_merge_request_path(
+ project.namespace,
+ project, merge_request
+ )
+ end
+
+ before do
+ login_as user
+ project.team << [user, :master]
+ end
+
+ it 'shows link to target branch' do
+ visit path_to_merge_request
+ expect(page).to have_link('feature', href: namespace_project_commits_path(project.namespace, project, merge_request.target_branch))
+ end
+
+ context 'when branch was deleted' do
+ before do
+ DeleteBranchService.new(project, user).execute('feature')
+ visit path_to_merge_request
+ end
+
+ it 'shows a message about missing target branch' do
+ expect(page).to have_content(
+ 'Target branch feature does not exist'
+ )
+ end
+
+ it 'does not show link to target branch' do
+ expect(page).not_to have_link('feature')
+ end
+ end
+end