summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-05-29 15:01:54 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-05-29 15:01:54 +0000
commita1c45338f37560b044f23f1af07fea7bef2107cd (patch)
treead9deb2fe7158f1cd52f9599255c013784eae8c0 /features
parentab2e67550b350efb73a397a53040ec9c46966b0d (diff)
parent5e4384ec9bc5e015c6a5427e337d8f5412e91d1e (diff)
downloadgitlab-ce-a1c45338f37560b044f23f1af07fea7bef2107cd.tar.gz
Merge branch 'support-edit-target-branch-in-mr' into 'master'
Support editing target branch of merge request ### What does this MR do? This MR makes it possible to edit the target branch of a merge request and adds a system note when this happens. ### Why was this MR needed? Because lots of people requested this feature. :) ### Screenshots **Edit MR page** ![image](https://gitlab.com/gitlab-org/gitlab-ce/uploads/9b3d405bf7b5f945e35bae3534c2b67b/image.png) **New MR page** ![image](https://gitlab.com/gitlab-org/gitlab-ce/uploads/3657a2a9efad6d10e8470637d1166bdb/image.png) **System note** ![image](https://gitlab.com/gitlab-org/gitlab-ce/uploads/cc8066f3d3bdf09c0cce27193210567d/image.png) ### What are the relevant issue numbers? * Closes https://github.com/gitlabhq/gitlabhq/issues/7105 * See: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/130! See merge request !738
Diffstat (limited to 'features')
-rw-r--r--features/project/merge_requests.feature8
-rw-r--r--features/steps/dashboard/dashboard.rb4
-rw-r--r--features/steps/project/merge_requests.rb14
3 files changed, 24 insertions, 2 deletions
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature
index 7a831901607..eb091c291e9 100644
--- a/features/project/merge_requests.feature
+++ b/features/project/merge_requests.feature
@@ -207,3 +207,11 @@ Feature: Project Merge Requests
Then I should see that I am subscribed
When I click button "Unsubscribe"
Then I should see that I am unsubscribed
+
+ @javascript
+ Scenario: I can change the target branch
+ Given I visit merge request page "Bug NS-04"
+ And I click link "Edit" for the merge request
+ When I click the "Target branch" dropdown
+ And I select a new target branch
+ Then I should see new target branch changes
diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb
index 8508b2a8096..bb1f2f444f9 100644
--- a/features/steps/dashboard/dashboard.rb
+++ b/features/steps/dashboard/dashboard.rb
@@ -23,8 +23,8 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
step 'I see prefilled new Merge Request page' do
current_path.should == new_namespace_project_merge_request_path(@project.namespace, @project)
find("#merge_request_target_project_id").value.should == @project.id.to_s
- find("#merge_request_source_branch").value.should == "fix"
- find("#merge_request_target_branch").value.should == "master"
+ find("input#merge_request_source_branch").value.should == "fix"
+ find("input#merge_request_target_branch").value.should == "master"
end
step 'user with name "John Doe" joined project "Shop"' do
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index 48bb316e203..4ca7cf5e5fe 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -305,6 +305,20 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
fill_in 'issue_search', with: "Fe"
end
+ step 'I click the "Target branch" dropdown' do
+ first('.target_branch').click
+ end
+
+ step 'I select a new target branch' do
+ select "feature", from: "merge_request_target_branch"
+ click_button 'Save'
+ end
+
+ step 'I should see new target branch changes' do
+ page.should have_content 'From fix into feature'
+ page.should have_content 'Target branch changed from master to feature'
+ end
+
def merge_request
@merge_request ||= MergeRequest.find_by!(title: "Bug NS-05")
end