|
|
|
|
@ -9,7 +9,7 @@ defmodule Plausible.Workers.SpikeNotifierTest do
|
|
|
|
|
insert(:spike_notification, site: site, threshold: 10, recipients: ["jerod@example.com", "uku@example.com"])
|
|
|
|
|
|
|
|
|
|
clickhouse_stub = stub(Plausible.Stats.Clickhouse, :current_visitors, fn _site, _query -> 5 end)
|
|
|
|
|
|> stub(:top_sources, fn _site, _query, _limit, _page -> [] end)
|
|
|
|
|
|> stub(:top_sources, fn _site, _query, _limit, _page, _show_noref -> [] end)
|
|
|
|
|
SpikeNotifier.perform(nil, nil, clickhouse_stub)
|
|
|
|
|
|
|
|
|
|
assert_no_emails_delivered()
|
|
|
|
|
@ -20,7 +20,7 @@ defmodule Plausible.Workers.SpikeNotifierTest do
|
|
|
|
|
insert(:spike_notification, site: site, threshold: 10, recipients: ["jerod@example.com", "uku@example.com"])
|
|
|
|
|
|
|
|
|
|
clickhouse_stub = stub(Plausible.Stats.Clickhouse, :current_visitors, fn _site, _query -> 10 end)
|
|
|
|
|
|> stub(:top_sources, fn _site, _query, _limit, _page -> [] end)
|
|
|
|
|
|> stub(:top_sources, fn _site, _query, _limit, _page, _show_noref -> [] end)
|
|
|
|
|
SpikeNotifier.perform(nil, nil, clickhouse_stub)
|
|
|
|
|
|
|
|
|
|
assert_email_delivered_with(
|
|
|
|
|
@ -38,7 +38,7 @@ defmodule Plausible.Workers.SpikeNotifierTest do
|
|
|
|
|
site = insert(:site)
|
|
|
|
|
insert(:spike_notification, site: site, threshold: 10, recipients: ["uku@example.com"])
|
|
|
|
|
clickhouse_stub = stub(Plausible.Stats.Clickhouse, :current_visitors, fn _site, _query -> 10 end)
|
|
|
|
|
|> stub(:top_sources, fn _site, _query, _limit, _page -> [] end)
|
|
|
|
|
|> stub(:top_sources, fn _site, _query, _limit, _page, _show_noref -> [] end)
|
|
|
|
|
|
|
|
|
|
SpikeNotifier.perform(nil, nil, clickhouse_stub)
|
|
|
|
|
|
|
|
|
|
|