Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-25 00:08:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-25 00:08:03 +0300
commit0b5e5c78a9d7acbf773d7ba5fd5c2ce9b6ffdb52 (patch)
tree64e092630aca6e42462003414519f22266dcbc25 /spec/services/work_items
parentd48b87d4675d6b8b56dd9b40afa9eb2dce32ad3b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/work_items')
-rw-r--r--spec/services/work_items/import_csv_service_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/work_items/import_csv_service_spec.rb b/spec/services/work_items/import_csv_service_spec.rb
index 658062ecdbe..83530c87c99 100644
--- a/spec/services/work_items/import_csv_service_spec.rb
+++ b/spec/services/work_items/import_csv_service_spec.rb
@@ -17,6 +17,7 @@ RSpec.describe WorkItems::ImportCsvService, feature_category: :team_planning do
let_it_be(:issue_type) { ::WorkItems::Type.default_issue_type }
let(:work_items) { ::WorkItems::WorkItemsFinder.new(user, project: project).execute }
+ let(:email_method) { :import_work_items_csv_email }
subject { service.execute }
@@ -26,6 +27,8 @@ RSpec.describe WorkItems::ImportCsvService, feature_category: :team_planning do
project.add_guest(user)
end
+ it_behaves_like 'importer with email notification'
+
context 'when file is valid' do
it 'creates the expected number of work items' do
expect { subject }.to change { work_items.count }.by 2
@@ -96,4 +99,14 @@ RSpec.describe WorkItems::ImportCsvService, feature_category: :team_planning do
end
end
end
+
+ context 'when user does not have permission' do
+ it 'errors on those lines', :aggregate_failures do
+ result = subject
+
+ expect(result[:success]).to eq(0)
+ expect(result[:error_lines]).to eq([2, 3])
+ expect(result[:parse_error]).to eq(false)
+ end
+ end
end