summaryrefslogtreecommitdiff
path: root/spec/support_specs/license_metadata_tags_spec.rb
blob: f89a32574c7e9dd1003f7c5d357e3764429762e1 (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'

# These specs only make sense if ee/spec/spec_helper is loaded
# In FOSS_ONLY=1 mode, nothing should happen
RSpec.describe 'license metadata tags', feature_category: :sm_provisioning, if: Gitlab.ee? do
  it 'applies the without_license metadata tag by default' do |example|
    expect(example.metadata[:without_license]).to eq(true)
  end

  it 'does not apply the with_license metadata tag by default' do |example|
    expect(example.metadata[:with_license]).to be_nil
  end

  it 'does not have a current license' do
    expect(License.current).to be_nil
  end

  context 'with with_license tag', :with_license do
    it 'has a current license' do
      expect(License.current).to be_present
    end
  end

  context 'with without_license tag', :without_license do
    it 'does not have a current license' do
      expect(License.current).to be_nil
    end
  end
end