diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 21:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-29 21:10:36 +0300 |
commit | 1bbd0179d7ed8fb17c0574aa74ef491e53c833a7 (patch) | |
tree | c74a9b9d8f7ad1cedb0995e10340820467a8ab6f /spec/views | |
parent | 4d3677a52dab1bb5c707ad493dcab8c8bca3dd8b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/notify/import_issues_csv_email.html.haml_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/views/notify/import_issues_csv_email.html.haml_spec.rb b/spec/views/notify/import_issues_csv_email.html.haml_spec.rb index c3d320a837b..2165cb6af85 100644 --- a/spec/views/notify/import_issues_csv_email.html.haml_spec.rb +++ b/spec/views/notify/import_issues_csv_email.html.haml_spec.rb @@ -8,6 +8,10 @@ RSpec.describe 'notify/import_issues_csv_email.html.haml' do let(:correct_results) { { success: 3, parse_error: false } } let(:errored_results) { { success: 3, error_lines: [5, 6, 7], parse_error: false } } let(:parse_error_results) { { success: 0, parse_error: true } } + let(:milestone_error_results) do + { success: 0, + preprocess_errors: { milestone_errors: { missing: { header: 'Milestone', titles: %w[15.10 15.11] } } } } + end before do assign(:user, user) @@ -58,4 +62,29 @@ a delimited text file that uses a comma to separate values.") Please make sure it has the correct format: a delimited text file that uses a comma to separate values.") end end + + context 'when preprocess errors reported while importing' do + before do + assign(:results, milestone_error_results) + end + + it 'renders with project name error' do + render + + expect(rendered).to have_content("Could not find the following milestone values in \ +#{project.full_name}: 15.10, 15.11") + end + + context 'with a project in a group' do + let_it_be(:group) { create(:group) } + let_it_be(:project) { create(:project, group: group) } + + it 'renders with group clause error' do + render + + expect(rendered).to have_content("Could not find the following milestone values in #{project.full_name} \ +or its parent groups: 15.10, 15.11") + end + end + end end |