Commit 7c3c901a authored by Douwe Maan's avatar Douwe Maan

Merge branch 'joshfng/gitlab-ce-fix-3802' into 'master'

Show 'New Merge Request' buttons on canonical repo. (by @joshfng)

Replaces https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2189 to run tests on our runners.

See merge request !2300
parents 9b127028 edd2ce38
...@@ -96,6 +96,8 @@ v 8.3.0 ...@@ -96,6 +96,8 @@ v 8.3.0
- Do not show build status unless builds are enabled and `.gitlab-ci.yml` is present - Do not show build status unless builds are enabled and `.gitlab-ci.yml` is present
- Persist runners registration token in database - Persist runners registration token in database
- Fix online editor should not remove newlines at the end of the file - Fix online editor should not remove newlines at the end of the file
- Expose Git's version in the admin area
- Show "New Merge Request" buttons on canonical repos when you have a fork (Josh Frye)
v 8.2.3 v 8.2.3
- Fix application settings cache not expiring after changes (Stan Hu) - Fix application settings cache not expiring after changes (Stan Hu)
......
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
= link_to url_for_new_issue(@project, only_path: true) do = link_to url_for_new_issue(@project, only_path: true) do
= icon('exclamation-circle fw') = icon('exclamation-circle fw')
New issue New issue
- if can?(current_user, :create_merge_request, @project) - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
- if merge_project
%li %li
= link_to new_namespace_project_merge_request_path(@project.namespace, @project) do = link_to new_namespace_project_merge_request_path(merge_project.namespace, merge_project) do
= icon('tasks fw') = icon('tasks fw')
New merge request New merge request
- if can?(current_user, :create_snippet, @project) - if can?(current_user, :create_snippet, @project)
......
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
.controls .controls
= render 'shared/issuable/search_form', path: namespace_project_merge_requests_path(@project.namespace, @project) = render 'shared/issuable/search_form', path: namespace_project_merge_requests_path(@project.namespace, @project)
- if can? current_user, :create_merge_request, @project - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
- if merge_project
.pull-left.hidden-xs .pull-left.hidden-xs
= link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-new", title: "New Merge Request" do = link_to new_namespace_project_merge_request_path(merge_project.namespace, merge_project), class: "btn btn-new", title: "New Merge Request" do
%i.fa.fa-plus %i.fa.fa-plus
New Merge Request New Merge Request
= render 'shared/issuable/filter', type: :merge_requests = render 'shared/issuable/filter', type: :merge_requests
......
...@@ -14,3 +14,14 @@ Feature: Project Fork ...@@ -14,3 +14,14 @@ Feature: Project Fork
And I click link "Fork" And I click link "Fork"
When I fork to my namespace When I fork to my namespace
Then I should see a "Name has already been taken" warning Then I should see a "Name has already been taken" warning
Scenario: Merge request on canonical repo goes to fork merge request page
Given I click link "Fork"
And I fork to my namespace
Then I should see the forked project page
When I visit project "Shop" page
Then I should see "New merge request"
And I goto the Merge Requests page
Then I should see "New merge request"
And I click link "New merge request"
Then I should see the new merge request page for my namespace
...@@ -30,4 +30,23 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps ...@@ -30,4 +30,23 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
click_link current_user.name click_link current_user.name
end end
end end
step 'I should see "New merge request"' do
expect(page).to have_content(/new merge request/i)
end
step 'I goto the Merge Requests page' do
page.within '.page-sidebar-expanded' do
click_link "Merge Requests"
end
end
step 'I click link "New merge request"' do
expect(page).to have_content(/new merge request/i)
click_link "New Merge Request"
end
step 'I should see the new merge request page for my namespace' do
current_path.should have_content(/#{current_user.namespace.name}/i)
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment