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

manifest_provider_repo_entity_spec.rb « import « serializers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c11f8c42559262e65453473ab6bce3dfc1f1709c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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