summaryrefslogtreecommitdiff
path: root/spec/support_specs/license_metadata_tags_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support_specs/license_metadata_tags_spec.rb')
-rw-r--r--spec/support_specs/license_metadata_tags_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/support_specs/license_metadata_tags_spec.rb b/spec/support_specs/license_metadata_tags_spec.rb
new file mode 100644
index 00000000000..f89a32574c7
--- /dev/null
+++ b/spec/support_specs/license_metadata_tags_spec.rb
@@ -0,0 +1,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