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

application_setting_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: 5adb825672cd630bea9d18fa1c368cb2cd94343a (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe API::Entities::ApplicationSetting do
  let_it_be(:application_setting, reload: true) { create(:application_setting) }

  subject(:output) { described_class.new(application_setting).as_json }

  context 'housekeeping_bitmaps_enabled usage is deprecated and always enabled' do
    before do
      application_setting.housekeeping_bitmaps_enabled = housekeeping_bitmaps_enabled
    end

    context 'when housekeeping_bitmaps_enabled db column is false' do
      let(:housekeeping_bitmaps_enabled) { false }

      it 'returns true' do
        expect(subject[:housekeeping_bitmaps_enabled]).to eq(true)
      end
    end

    context 'when housekeeping_bitmaps_enabled db column is true' do
      let(:housekeeping_bitmaps_enabled) { false }

      it 'returns true' do
        expect(subject[:housekeeping_bitmaps_enabled]).to eq(true)
      end
    end
  end
end