diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/support/shared_examples/services/issuable/issuable_import_csv_service_shared_examples.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/support/shared_examples/services/issuable/issuable_import_csv_service_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/services/issuable/issuable_import_csv_service_shared_examples.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/support/shared_examples/services/issuable/issuable_import_csv_service_shared_examples.rb b/spec/support/shared_examples/services/issuable/issuable_import_csv_service_shared_examples.rb index 8a3ab07bbfe..aa31bd2b604 100644 --- a/spec/support/shared_examples/services/issuable/issuable_import_csv_service_shared_examples.rb +++ b/spec/support/shared_examples/services/issuable/issuable_import_csv_service_shared_examples.rb @@ -30,7 +30,7 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type| context 'with a file generated by Gitlab CSV export' do let(:file) { fixture_file_upload('spec/fixtures/csv_gitlab_export.csv') } - let!(:test_milestone) { create(:milestone, project: project, title: 'v1.0') } + let_it_be(:test_milestone) { create(:milestone, project: project, title: 'v1.0') } it 'imports the CSV without errors' do expect(subject[:success]).to eq(4) @@ -41,7 +41,19 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type| it 'correctly sets the issuable attributes' do expect { subject }.to change { issuables.count }.by 4 - expect(issuables.reload).to include(have_attributes({ title: 'Test Title', description: 'Test Description' })) + if issuable_type == 'issue' + expect(issuables.reload).to include( + have_attributes({ title: 'Test Title', description: 'Test Description', milestone_id: test_milestone.id }), + have_attributes({ title: 'Title', milestone_id: test_milestone.id }), + have_attributes( + { title: 'Nihil impedit neque quos totam ut aut enim cupiditate doloribus molestiae.', + description: 'Omnis aliquid sint laudantium quam.', + milestone_id: test_milestone.id }) + ) + + else + expect(issuables.reload).to include(have_attributes({ title: 'Test Title', description: 'Test Description' })) + end end it_behaves_like 'importer with email notification' |