summaryrefslogtreecommitdiff
path: root/features/steps
diff options
context:
space:
mode:
authorPierre de La Morinerie <pierre@capitainetrain.com>2016-02-04 19:23:58 +0100
committerPierre de La Morinerie <pierre@capitainetrain.com>2016-03-03 15:11:44 +0100
commit543845f7efe0b70926ea699eaf1e413fa878b285 (patch)
treef37858135e9ce5ac7c5bd7e4aad685582c363686 /features/steps
parent566ea8543d971c4b811b2939b0677c5db52feab3 (diff)
downloadgitlab-ce-543845f7efe0b70926ea699eaf1e413fa878b285.tar.gz
Indicate how much an MR branch diverges from the target branch
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/project/merge_requests.rb29
-rw-r--r--features/steps/shared/paths.rb8
2 files changed, 36 insertions, 1 deletions
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index dde864f5180..8bf423cc64b 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -60,7 +60,6 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
expect(page).not_to have_content "Feature NS-03"
end
-
step 'I should not see "Bug NS-04" in merge requests' do
expect(page).not_to have_content "Bug NS-04"
end
@@ -121,6 +120,22 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
author: project.users.first)
end
+ step 'project "Shop" have "Bug NS-07" open merge request with rebased branch' do
+ create(:merge_request, :rebased,
+ title: "Bug NS-07",
+ source_project: project,
+ target_project: project,
+ author: project.users.first)
+ end
+
+ step 'project "Shop" have "Bug NS-08" open merge request with diverged branch' do
+ create(:merge_request, :diverged,
+ title: "Bug NS-08",
+ source_project: project,
+ target_project: project,
+ author: project.users.first)
+ end
+
step 'project "Shop" have "Feature NS-03" closed merge request' do
create(:closed_merge_request,
title: "Feature NS-03",
@@ -490,6 +505,18 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
+ step 'I should see the diverged commits count' do
+ page.within ".mr-source-target" do
+ expect(page).to have_content /([0-9]+ commits behind)/
+ end
+ end
+
+ step 'I should not see the diverged commits count' do
+ page.within ".mr-source-target" do
+ expect(page).not_to have_content /([0-9]+ commit[s]? behind)/
+ end
+ end
+
step 'I should see "Bug NS-05" at the top' do
expect(page.find('ul.content-list.mr-list li.merge-request:first-child')).to have_content("Bug NS-05")
end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index f7812a707c4..da9d1503ebc 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -395,6 +395,14 @@ module SharedPaths
visit merge_request_path("Bug NS-05")
end
+ step 'I visit merge request page "Bug NS-07"' do
+ visit merge_request_path("Bug NS-07")
+ end
+
+ step 'I visit merge request page "Bug NS-08"' do
+ visit merge_request_path("Bug NS-08")
+ end
+
step 'I visit merge request page "Bug CO-01"' do
mr = MergeRequest.find_by(title: "Bug CO-01")
visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr)