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

project_entity_spec.rb « integrations « serializers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1564f7fad639658c3eb098f95556a3fb90b65154 (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Integrations::ProjectEntity do
  let_it_be(:project) { create(:project, :with_avatar) }

  let(:entity) do
    described_class.new(project)
  end

  context 'as json' do
    include Gitlab::Routing.url_helpers

    subject { entity.as_json }

    it 'contains needed attributes' do
      expect(subject).to include(
        avatar_url: include('uploads'),
        name: project.name,
        full_path: project_path(project),
        full_name: project.full_name
      )
    end
  end
end