Commit 1747a573 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Hide `new merge request` button from index page

When a project is archived, don't show the button on the index page
of merge requests
parent fe9389ba
- @no_container = true - @no_container = true
- @can_bulk_update = can?(current_user, :admin_merge_request, @project) - @can_bulk_update = can?(current_user, :admin_merge_request, @project)
- merge_project = can?(current_user, :create_merge_request_from, @project) ? @project : (current_user && current_user.fork_of(@project)) - merge_project = merge_request_source_project_for_project(@project)
- new_merge_request_path = project_new_merge_request_path(merge_project) if merge_project - new_merge_request_path = project_new_merge_request_path(merge_project) if merge_project
- page_title "Merge Requests" - page_title "Merge Requests"
......
...@@ -94,6 +94,18 @@ describe 'User views open merge requests' do ...@@ -94,6 +94,18 @@ describe 'User views open merge requests' do
end end
include_examples 'shows merge requests' include_examples 'shows merge requests'
it 'shows the new merge request button' do
expect(page).to have_link('New merge request')
end
context 'when the project is archived' do
let(:project) { create(:project, :public, :repository, archived: true) }
it 'hides the new merge request button' do
expect(page).not_to have_link('New merge request')
end
end
end 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