diff options
Diffstat (limited to 'spec/serializers/import/manifest_provider_repo_entity_spec.rb')
-rw-r--r-- | spec/serializers/import/manifest_provider_repo_entity_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/serializers/import/manifest_provider_repo_entity_spec.rb b/spec/serializers/import/manifest_provider_repo_entity_spec.rb new file mode 100644 index 00000000000..c11f8c42559 --- /dev/null +++ b/spec/serializers/import/manifest_provider_repo_entity_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Import::ManifestProviderRepoEntity do + let(:current_user) { create(:user) } + let(:request) { double(:request, current_user: current_user) } + let(:repo_data) do + { + id: 1, + url: 'http://demo.repo/url', + path: '/demo/path' + } + end + + subject { described_class.represent(repo_data, { group_full_path: 'group', request: request }).as_json } + + it_behaves_like 'exposes required fields for import entity' do + let(:expected_values) do + { + id: repo_data[:id], + full_name: repo_data[:url], + sanitized_name: nil, + provider_link: repo_data[:url] + } + end + end +end |