Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6175fd97
Commit
6175fd97
authored
May 03, 2021
by
Rajendra Kadam
Committed by
Mark Chao
May 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use expect_no_snowplow_event (updated to accept args)
Check for category and action to be nil
parent
674f3cd5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
ee/spec/support/shared_examples/controllers/concerns/group_invite_members_shared_examples.rb
...trollers/concerns/group_invite_members_shared_examples.rb
+1
-5
spec/support/helpers/snowplow_helpers.rb
spec/support/helpers/snowplow_helpers.rb
+6
-2
No files found.
ee/spec/support/shared_examples/controllers/concerns/group_invite_members_shared_examples.rb
View file @
6175fd97
...
@@ -2,10 +2,6 @@
...
@@ -2,10 +2,6 @@
RSpec
.
shared_examples
GroupInviteMembers
do
RSpec
.
shared_examples
GroupInviteMembers
do
context
'when inviting members'
,
:snowplow
do
context
'when inviting members'
,
:snowplow
do
before
do
allow
(
Gitlab
::
Tracking
).
to
receive
(
:event
)
# rubocop:disable RSpec/ExpectGitlabTracking
end
context
'without valid emails in the params'
do
context
'without valid emails in the params'
do
it
'no invites generated by default'
do
it
'no invites generated by default'
do
subject
subject
...
@@ -16,7 +12,7 @@ RSpec.shared_examples GroupInviteMembers do
...
@@ -16,7 +12,7 @@ RSpec.shared_examples GroupInviteMembers do
it
'does not track the event'
do
it
'does not track the event'
do
subject
subject
expect
(
Gitlab
::
Tracking
).
not_to
have_received
(
:event
).
with
(
anything
,
'invite_members'
,
label:
'new_group_form'
)
# rubocop:disable RSpec/ExpectGitlabTracking
expect
_no_snowplow_event
(
category:
anything
,
action:
'invite_members'
,
label:
'new_group_form'
)
end
end
end
end
...
...
spec/support/helpers/snowplow_helpers.rb
View file @
6175fd97
...
@@ -71,7 +71,11 @@ module SnowplowHelpers
...
@@ -71,7 +71,11 @@ module SnowplowHelpers
# expect_no_snowplow_event
# expect_no_snowplow_event
# end
# end
# end
# end
def
expect_no_snowplow_event
def
expect_no_snowplow_event
(
category:
nil
,
action:
nil
,
**
kwargs
)
if
category
&&
action
expect
(
Gitlab
::
Tracking
).
not_to
have_received
(
:event
).
with
(
category
,
action
,
**
kwargs
)
# rubocop:disable RSpec/ExpectGitlabTracking
else
expect
(
Gitlab
::
Tracking
).
not_to
have_received
(
:event
)
# rubocop:disable RSpec/ExpectGitlabTracking
expect
(
Gitlab
::
Tracking
).
not_to
have_received
(
:event
)
# rubocop:disable RSpec/ExpectGitlabTracking
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment