Admin analytics: heatmap per device, anteprima staff e analisi costi.
Separa heatmap mobile/desktop, opt-out analytics per operatori, dashboard costi con KPI e trend mensili. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,16 +29,36 @@ RSpec.describe "Analytics snapshots", type: :request do
|
||||
end
|
||||
|
||||
it "rifiuta path esclusi" do
|
||||
post "/analytics/snapshot",
|
||||
params: {
|
||||
path: "/admin/analytics",
|
||||
device: "desktop",
|
||||
width: 1440,
|
||||
height: 900,
|
||||
image: jpeg_upload
|
||||
}
|
||||
expect do
|
||||
post "/analytics/snapshot",
|
||||
params: {
|
||||
path: "/admin/analytics",
|
||||
device: "desktop",
|
||||
width: 1440,
|
||||
height: 900,
|
||||
image: jpeg_upload
|
||||
}
|
||||
end.not_to change(AnalyticsPageSnapshot, :count)
|
||||
|
||||
expect(response).to have_http_status(:unprocessable_content)
|
||||
expect(AnalyticsPageSnapshot.count).to eq(0)
|
||||
end
|
||||
|
||||
it "salta snapshot con cookie anteprima staff" do
|
||||
expect do
|
||||
post "/analytics/snapshot",
|
||||
params: {
|
||||
path: "/prezzi-suppress",
|
||||
device: "desktop",
|
||||
width: 1440,
|
||||
height: 2200,
|
||||
image: jpeg_upload
|
||||
},
|
||||
headers: { "Cookie" => "#{Analytics::Suppress::COOKIE_NAME}=1" }
|
||||
end.not_to change(AnalyticsPageSnapshot, :count)
|
||||
|
||||
expect(response).to have_http_status(:accepted)
|
||||
body = JSON.parse(response.body)
|
||||
expect(body["skipped"]).to eq(true)
|
||||
expect(body["suppressed"]).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user