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