summaryrefslogtreecommitdiff
path: root/spec/serializers/import/bitbucket_server_provider_repo_entity_spec.rb
blob: 9891809cc67307d7f704ff92746f21060557efa1 (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
# frozen_string_literal: true

require 'spec_helper'

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