Commit b289f9a6 authored by Axel García's avatar Axel García Committed by Axel Garcia

Check hard-coded data-track-event instances

parent e2feb523
# frozen_string_literal: true
module TrackingHelper
def tracking_attrs(label, event, property)
def tracking_attrs(label, action, property)
return {} unless tracking_enabled?
{
data: {
track_label: label,
track_event: event,
track_action: action,
track_property: property
}
}
......
......@@ -51,7 +51,8 @@ end
js_patterns = Regexp.union(
'Tracking.event',
/\btrack\(/,
'data-track-event'
'data-track-event',
'data-track-action'
)
dictionary_pattern = Regexp.union(
......
......@@ -10,7 +10,7 @@ RSpec.describe TrackingHelper do
let(:results) do
{
no_data: {},
with_data: { data: { track_label: 'a', track_event: 'b', track_property: 'c' } }
with_data: { data: { track_label: 'a', track_action: 'b', track_property: 'c' } }
}
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