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

bitbucket_server_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: 8fe9fa16904431d44b894dabd6a60c761c137af3 (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
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Import::BitbucketServerProviderRepoEntity do
  let(:repo_data) do
    {
      'name' => 'test',
      'project' => {
        'name' => 'demo'
      },
      'links' => {
        'self' => [
          {
            'href' => 'http://local.bitbucket.server/demo/test.git',
            'name' => 'http'
          }
        ]
      }
    }
  end

  let(:repo) { BitbucketServer::Representation::Repo.new(repo_data) }

  subject { described_class.new(repo).as_json }

  it_behaves_like 'exposes required fields for import entity' do
    let(:expected_values) do
      {
        id: 'demo/test',
        full_name: 'demo/test',
        sanitized_name: 'test',
        provider_link: 'http://local.bitbucket.server/demo/test.git'
      }
    end
  end
end