Commit b0b56da0 authored by Nicolas Dular's avatar Nicolas Dular

Remove snowplow spec helper fix

Ruby 2.6.x wasn't able to resolve **kwargs correctly and always added an
empty Hash, although there was non given.

This behaviour changed with Ruby 2.7.x and we can therefore remove the
fix again.
parent dee53416
...@@ -32,16 +32,8 @@ module SnowplowHelpers ...@@ -32,16 +32,8 @@ module SnowplowHelpers
# end # end
# end # end
def expect_snowplow_event(category:, action:, **kwargs) def expect_snowplow_event(category:, action:, **kwargs)
# This check will no longer be needed with Ruby 2.7 which expect(Gitlab::Tracking).to have_received(:event) # rubocop:disable RSpec/ExpectGitlabTracking
# would not pass any arguments when using **kwargs. .with(category, action, **kwargs).at_least(:once)
# https://gitlab.com/gitlab-org/gitlab/-/issues/263430
if kwargs.present?
expect(Gitlab::Tracking).to have_received(:event) # rubocop:disable RSpec/ExpectGitlabTracking
.with(category, action, **kwargs).at_least(:once)
else
expect(Gitlab::Tracking).to have_received(:event) # rubocop:disable RSpec/ExpectGitlabTracking
.with(category, action).at_least(:once)
end
end end
# Asserts that no call to `Gitlab::Tracking#event` was made. # Asserts that no call to `Gitlab::Tracking#event` was made.
......
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