diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-06 18:07:26 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-11 11:51:16 +0300 |
commit | 1747a573dff40ab51ba892bf9f5293e3c9b794d6 (patch) | |
tree | dfa7525dde6c550e98e53c415d4f5e35b380feb1 /spec/features | |
parent | fe9389ba6c10e9addefc6e647f1476ff765236d9 (diff) |
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
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/merge_requests/user_views_open_merge_requests_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/features/projects/merge_requests/user_views_open_merge_requests_spec.rb b/spec/features/projects/merge_requests/user_views_open_merge_requests_spec.rb index bf95dbb7d09..08826625842 100644 --- a/spec/features/projects/merge_requests/user_views_open_merge_requests_spec.rb +++ b/spec/features/projects/merge_requests/user_views_open_merge_requests_spec.rb @@ -94,6 +94,18 @@ describe 'User views open merge requests' do end 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 |