Commit 4b663bbe authored by alinamihaila's avatar alinamihaila

Use git add . for checking skip_validation

parent ac440507
......@@ -82,9 +82,7 @@ module Gitlab
end
def skip_validation?
return false if attributes[:skip_validation].blank?
attributes[:skip_validation]
!!attributes[:skip_validation]
end
end
end
......
......@@ -66,10 +66,18 @@ RSpec.describe Gitlab::Usage::MetricDefinition do
described_class.new(path, attributes).validate!
end
it 'does not raise exception if has skip_validation: true' do
expect(Gitlab::ErrorTracking).not_to receive(:track_and_raise_for_dev_exception)
context 'with skip_validation' do
it 'raise exception if skip_validation: false' do
expect(Gitlab::ErrorTracking).to receive(:track_and_raise_for_dev_exception).at_least(:once).with(instance_of(Gitlab::Usage::Metric::InvalidMetricError))
described_class.new(path, attributes.merge( { skip_validation: true } )).validate!
described_class.new(path, attributes.merge( { skip_validation: false } )).validate!
end
it 'does not raise exception if has skip_validation: true' do
expect(Gitlab::ErrorTracking).not_to receive(:track_and_raise_for_dev_exception)
described_class.new(path, attributes.merge( { skip_validation: true } )).validate!
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment