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

group_spec.rb « entities « api « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 270ac323c7d41051f9a0963edc8ab846c35addf6 (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe API::Entities::Group, feature_category: :groups_and_projects do
  let_it_be(:group) do
    base_group = create(:group) { |g| create(:project_statistics, namespace_id: g.id) }
    Group.with_statistics.find(base_group.id)
  end

  subject(:json) { described_class.new(group, { with_custom_attributes: true, statistics: true }).as_json }

  it 'returns expected data' do
    expect(json.keys).to(
      include(
        :organization_id, :path, :description, :visibility, :share_with_group_lock, :require_two_factor_authentication,
        :two_factor_grace_period, :project_creation_level, :auto_devops_enabled,
        :subgroup_creation_level, :emails_disabled, :emails_enabled, :lfs_enabled, :default_branch_protection,
        :default_branch_protection_defaults, :avatar_url, :request_access_enabled, :full_name, :full_path, :created_at,
        :parent_id, :organization_id, :shared_runners_setting, :custom_attributes, :statistics
      )
    )
  end
end