summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-26 12:33:48 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-26 12:33:48 +0200
commit1ff1b6d816cd1150df436a8ff56502e8adfa1b0e (patch)
tree198b14c97b07839d9915b57e7905bf43cfe20c1f /features
parent93cdf8a312466a459b74c30236704582a9fccbed (diff)
parent9439cb55260185b4a456982613f657f3c1b11915 (diff)
downloadgitlab-ce-1ff1b6d816cd1150df436a8ff56502e8adfa1b0e.tar.gz
Merge pull request #5719 from jacob-carlborg/mr_target
By default, target original repository if it's a fork when creating new MR.
Diffstat (limited to 'features')
-rw-r--r--features/project/forked_merge_requests.feature6
-rw-r--r--features/steps/project/project_forked_merge_requests.rb10
2 files changed, 14 insertions, 2 deletions
diff --git a/features/project/forked_merge_requests.feature b/features/project/forked_merge_requests.feature
index 966905645a2..2d94b98c90b 100644
--- a/features/project/forked_merge_requests.feature
+++ b/features/project/forked_merge_requests.feature
@@ -32,3 +32,9 @@ Feature: Project Forked Merge Requests
And I fill out an invalid "Merge Request On Forked Project" merge request
And I submit the merge request
Then I should see validation errors
+
+ @javascript
+ Scenario: Merge request should target fork repository by default
+ Given I visit project "Forked Shop" merge requests page
+ And I click link "New Merge Request"
+ Then the target repository should be the original repository \ No newline at end of file
diff --git a/features/steps/project/project_forked_merge_requests.rb b/features/steps/project/project_forked_merge_requests.rb
index 4cc99f8af55..df69cb75437 100644
--- a/features/steps/project/project_forked_merge_requests.rb
+++ b/features/steps/project/project_forked_merge_requests.rb
@@ -159,8 +159,11 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
step 'I fill out an invalid "Merge Request On Forked Project" merge request' do
#If this isn't filled in the rest of the validations won't be triggered
fill_in "merge_request_title", with: "Merge Request On Forked Project"
+
+ select "Select branch", from: "merge_request_target_branch"
+
find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s
- find(:select, "merge_request_target_project_id", {}).value.should == @forked_project.id.to_s
+ find(:select, "merge_request_target_project_id", {}).value.should == project.id.to_s
find(:select, "merge_request_source_branch", {}).value.should == ""
find(:select, "merge_request_target_branch", {}).value.should == ""
end
@@ -168,7 +171,10 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
step 'I should see validation errors' do
page.should have_content "Source branch can't be blank"
page.should have_content "Target branch can't be blank"
- page.should have_content "Branch conflict You can not use same project/branch for source and target"
+ end
+
+ step 'the target repository should be the original repository' do
+ page.should have_select("merge_request_target_project_id", selected: project.path_with_namespace)
end
def project