diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-14 09:07:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-14 09:07:03 +0300 |
commit | 4fc8a5035217a603a5af54aab09bb7c1bfea7626 (patch) | |
tree | 760de5425c0064a744fb21aa18aecf720b85dc8e /spec/views | |
parent | 27715675e849d90937a5d3e2db3c4997018f7832 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/projects/merge_requests/_close_reopen_draft_report_toggle.html.haml_spec.rb | 34 | ||||
-rw-r--r-- | spec/views/projects/merge_requests/show.html.haml_spec.rb | 45 |
2 files changed, 0 insertions, 79 deletions
diff --git a/spec/views/projects/merge_requests/_close_reopen_draft_report_toggle.html.haml_spec.rb b/spec/views/projects/merge_requests/_close_reopen_draft_report_toggle.html.haml_spec.rb deleted file mode 100644 index 99339e956cc..00000000000 --- a/spec/views/projects/merge_requests/_close_reopen_draft_report_toggle.html.haml_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'projects/merge_requests/_close_reopen_draft_report_toggle.html.haml' do - let_it_be(:merge_request) { create(:merge_request, state: :merged) } - - before do - assign(:merge_request, merge_request) - assign(:project, merge_request.target_project) - - allow(view).to receive(:moved_mr_sidebar_enabled?).and_return(true) - end - - describe 'notifcations toggle' do - context 'when mr merged and logged in' do - it 'is present' do - allow(view).to receive(:current_user).and_return(merge_request.author) - - render - - expect(rendered).to have_css('li', class: 'js-sidebar-subscriptions-widget-root') - end - end - - context 'when mr merged and not logged in' do - it 'is not present' do - render - - expect(rendered).not_to have_css('li', class: 'js-sidebar-subscriptions-widget-root') - end - end - end -end diff --git a/spec/views/projects/merge_requests/show.html.haml_spec.rb b/spec/views/projects/merge_requests/show.html.haml_spec.rb deleted file mode 100644 index 86a4b25f746..00000000000 --- a/spec/views/projects/merge_requests/show.html.haml_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'projects/merge_requests/show.html.haml', :aggregate_failures do - using RSpec::Parameterized::TableSyntax - - include_context 'merge request show action' - - before do - merge_request.reload - end - - context 'when the merge request is open' do - it 'shows the "Mark as draft" button' do - render - - expect(rendered).to have_css('a', visible: true, text: 'Mark as draft') - expect(rendered).to have_css('a', visible: true, text: 'Close') - end - end - - context 'when the merge request is closed' do - before do - merge_request.close! - end - - it 'shows the "Reopen" button' do - render - - expect(rendered).not_to have_css('a', visible: true, text: 'Mark as draft') - expect(rendered).to have_css('a', visible: true, text: 'Reopen') - end - - context 'when source project does not exist' do - it 'does not show the "Reopen" button' do - allow(merge_request).to receive(:source_project).and_return(nil) - - render - - expect(rendered).not_to have_css('a', visible: false, text: 'Reopen') - end - end - end -end |