summaryrefslogtreecommitdiff
path: root/spec/serializers/import/bulk_import_entity_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /spec/serializers/import/bulk_import_entity_spec.rb
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/serializers/import/bulk_import_entity_spec.rb')
-rw-r--r--spec/serializers/import/bulk_import_entity_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/serializers/import/bulk_import_entity_spec.rb b/spec/serializers/import/bulk_import_entity_spec.rb
new file mode 100644
index 00000000000..f35684bef20
--- /dev/null
+++ b/spec/serializers/import/bulk_import_entity_spec.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Import::BulkImportEntity do
+ let(:importable_data) do
+ {
+ 'id' => 1,
+ 'full_name' => 'test',
+ 'full_path' => 'full/path/test',
+ 'foo' => 'bar'
+ }
+ end
+
+ subject { described_class.represent(importable_data).as_json }
+
+ %w[id full_name full_path].each do |attribute|
+ it "exposes #{attribute}" do
+ expect(subject[attribute.to_sym]).to eq(importable_data[attribute])
+ end
+ end
+
+ it 'does not expose unspecified attributes' do
+ expect(subject[:foo]).to be_nil
+ end
+end