File: application_settings_spec.rb

package info (click to toggle)
ruby-gitlab 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,660 kB
  • sloc: ruby: 12,582; makefile: 7; sh: 4
file content (39 lines) | stat: -rw-r--r-- 1,260 bytes parent folder | download
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
38
39
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Client do
  it { is_expected.to respond_to :application_settings }
  it { is_expected.to respond_to :edit_application_settings }

  describe '.application_settings' do
    before do
      stub_get('/application/settings', 'application_settings')
      @application_settings = Gitlab.application_settings
    end

    it 'gets the correct resource' do
      expect(a_get('/application/settings')).to have_been_made
    end

    it 'returns a paginated response of projects' do
      expect(@application_settings).to be_a Gitlab::ObjectifiedHash
      expect(@application_settings.default_projects_limit).to eq(100_000)
    end
  end

  describe '.edit_application_settings' do
    before do
      stub_put('/application/settings', 'application_settings').with(body: { signup_enabled: true })
      @edited_application_settings = Gitlab.edit_application_settings(signup_enabled: true)
    end

    it 'gets the correct resource' do
      expect(a_put('/application/settings').with(body: { signup_enabled: true })).to have_been_made
    end

    it 'returns information about an edited project' do
      expect(@edited_application_settings.signup_enabled).to be(true)
    end
  end
end