Files
MatchLiveTv/backend/spec/services/analytics/path_normalizer_spec.rb
eminuxandCursor 8a07c5d569 Aggiunge heatmaps first-party (click/scroll) con pagina admin Analytics.
Raccoglie eventi aggregati dietro consenso cookie, senza PII né tracking su admin/regia/live/replay; GA4 resta invariato.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-20 22:50:15 +02:00

20 lines
780 B
Ruby

# frozen_string_literal: true
require "rails_helper"
RSpec.describe Analytics::PathNormalizer do
it "normalizza UUID e token" do
expect(described_class.normalize("/clubs/461d369a-104c-4d3c-8860-1518b4e95d35/billing"))
.to eq("/clubs/:id/billing")
end
it "esclude admin, regia, live player e replay" do
expect(described_class.excluded?("/admin/sessions")).to be(true)
expect(described_class.excluded?("/regia/abc")).to be(true)
expect(described_class.excluded?("/live/461d369a-104c-4d3c-8860-1518b4e95d35")).to be(true)
expect(described_class.excluded?("/replay/461d369a-104c-4d3c-8860-1518b4e95d35")).to be(true)
expect(described_class.excluded?("/live")).to be(false)
expect(described_class.excluded?("/prezzi")).to be(false)
end
end