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>2020-10-05 18:08:56 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-05 18:08:56 +0300
commit61265b9f01c7db3d4f6e1266d165b1c85be7b9e7 (patch)
treeb6589df984e18e3b008a155c8d9ffcae75cf7c91 /spec/serializers
parent5460c19548d3d3d2ff764ceff05c2b72aa2d3a32 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-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