summaryrefslogtreecommitdiff
path: root/spec/models/bulk_imports/entity_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-16 18:10:00 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-16 18:10:00 +0000
commit8d68ae988d62d732523354b1892988e31c53cb54 (patch)
treead87af650dd6dd9c59bbfdcf9fb74ddf1651f1ba /spec/models/bulk_imports/entity_spec.rb
parentf0718f2099663226531b8916e14d5582eb28e453 (diff)
downloadgitlab-ce-8d68ae988d62d732523354b1892988e31c53cb54.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/bulk_imports/entity_spec.rb')
-rw-r--r--spec/models/bulk_imports/entity_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/bulk_imports/entity_spec.rb b/spec/models/bulk_imports/entity_spec.rb
index f4f2b174a7b..b1c65c6b9ee 100644
--- a/spec/models/bulk_imports/entity_spec.rb
+++ b/spec/models/bulk_imports/entity_spec.rb
@@ -325,4 +325,24 @@ RSpec.describe BulkImports::Entity, type: :model do
expect(project_entity.update_service).to eq(::Projects::UpdateService)
end
end
+
+ describe '#full_path' do
+ it 'returns group full path for project entity' do
+ group_entity = build(:bulk_import_entity, :group_entity, group: build(:group))
+
+ expect(group_entity.full_path).to eq(group_entity.group.full_path)
+ end
+
+ it 'returns project full path for project entity' do
+ project_entity = build(:bulk_import_entity, :project_entity, project: build(:project))
+
+ expect(project_entity.full_path).to eq(project_entity.project.full_path)
+ end
+
+ it 'returns nil when not associated with group or project' do
+ entity = build(:bulk_import_entity, group: nil, project: nil)
+
+ expect(entity.full_path).to eq(nil)
+ end
+ end
end