diff options
Diffstat (limited to 'spec/lib/gitlab/usage/metric_definition_spec.rb')
-rw-r--r-- | spec/lib/gitlab/usage/metric_definition_spec.rb | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/spec/lib/gitlab/usage/metric_definition_spec.rb b/spec/lib/gitlab/usage/metric_definition_spec.rb index 8dcb9ac0536..445a4ce972b 100644 --- a/spec/lib/gitlab/usage/metric_definition_spec.rb +++ b/spec/lib/gitlab/usage/metric_definition_spec.rb @@ -87,26 +87,21 @@ RSpec.describe Gitlab::Usage::MetricDefinition do describe 'statuses' do using RSpec::Parameterized::TableSyntax - where(:status, :raise_exception) do - 'deprecated' | false - 'removed' | false + where(:status, :skip_validation?) do + 'deprecated' | true + 'removed' | true 'data_available' | false - 'random' | true + 'implemented' | false + 'not_used' | false end with_them do subject(:validation) do - described_class.new(path, attributes.merge( { status: status } )).validate! + described_class.new(path, attributes.merge( { status: status } )).send(:skip_validation?) end - it "checks for valid/invalid statuses" do - if raise_exception - expect(Gitlab::ErrorTracking).to receive(:track_and_raise_for_dev_exception).at_least(:once).with(instance_of(Gitlab::Usage::Metric::InvalidMetricError)) - else - expect(Gitlab::ErrorTracking).not_to receive(:track_and_raise_for_dev_exception) - end - - validation + it 'returns true/false for skip_validation' do + expect(validation).to eq(skip_validation?) end end end |