diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/support/helpers/snowplow_helpers.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/support/helpers/snowplow_helpers.rb')
-rw-r--r-- | spec/support/helpers/snowplow_helpers.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/support/helpers/snowplow_helpers.rb b/spec/support/helpers/snowplow_helpers.rb index 83a5b7e48bc..3bde01c6fbf 100644 --- a/spec/support/helpers/snowplow_helpers.rb +++ b/spec/support/helpers/snowplow_helpers.rb @@ -32,8 +32,16 @@ module SnowplowHelpers # end # end def expect_snowplow_event(category:, action:, **kwargs) - expect(Gitlab::Tracking).to have_received(:event) - .with(category, action, **kwargs).at_least(:once) + # This check will no longer be needed with Ruby 2.7 which + # would not pass any arguments when using **kwargs. + # https://gitlab.com/gitlab-org/gitlab/-/issues/263430 + if kwargs.present? + expect(Gitlab::Tracking).to have_received(:event) + .with(category, action, **kwargs).at_least(:once) + else + expect(Gitlab::Tracking).to have_received(:event) + .with(category, action).at_least(:once) + end end # Asserts that no call to `Gitlab::Tracking#event` was made. |