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

ldap_encrypted_secrets_metric_spec.rb « instrumentations « metrics « usage « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1775304ad87f363ef82cd3abf6a2aa1fd286f5cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Usage::Metrics::Instrumentations::LdapEncryptedSecretsMetric, feature_category: :service_ping do
  using RSpec::Parameterized::TableSyntax

  let(:encrypted_config) { instance_double(Gitlab::EncryptedConfiguration) }

  where(:ldap_encrypted_secrets_enabled, :expected_value) do
    true  | true
    false | false
  end

  with_them do
    before do
      allow(Gitlab::Auth::Ldap::Config).to receive(:encrypted_secrets).and_return(encrypted_config)
      allow(encrypted_config).to receive(:active?).and_return(ldap_encrypted_secrets_enabled)
    end

    it_behaves_like 'a correct instrumented metric value', { time_frame: 'none' }
  end
end