diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/features/merge_request/user_suggests_changes_on_diff_spec.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) | |
download | gitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/features/merge_request/user_suggests_changes_on_diff_spec.rb')
-rw-r--r-- | spec/features/merge_request/user_suggests_changes_on_diff_spec.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb index beb658bb7a0..f77a42ee506 100644 --- a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb +++ b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb @@ -379,4 +379,41 @@ RSpec.describe 'User comments on a diff', :js do end end end + + context 'failed to load metadata' do + let(:dummy_controller) do + Class.new(Projects::MergeRequests::DiffsController) do + def diffs_metadata + render json: '', status: :internal_server_error + end + end + end + + before do + stub_const('Projects::MergeRequests::DiffsController', dummy_controller) + + click_diff_line(find_by_scrolling("[id='#{sample_compare.changes[1][:line_code]}']")) + + page.within('.js-discussion-note-form') do + fill_in('note_note', with: "```suggestion\n# change to a comment\n```") + click_button('Add comment now') + end + + wait_for_requests + + visit(project_merge_request_path(project, merge_request)) + + wait_for_requests + end + + it 'displays an error' do + page.within('.discussion-notes') do + click_button('Apply suggestion') + + wait_for_requests + + expect(page).to have_content('Unable to fully load the default commit message. You can still apply this suggestion and the commit message will be correct.') + end + end + end end |