docbrown/spec/factories/ahoy.rb
Vaidehi Joshi 35b516a60d
Add metrics around welcome notifications + their click events (#9239)
* Log to DataDog when a welcome notification is created

* Fix typo in Metrics::RecordDailyUsageWorker

* Add Metrics::RecordDailyNotificationsWorker to log notification counts to DataDog

* Add specs around DataDog logging for welcome notifications + click events

* Call Metrics::RecordDailyNotificationsWorker from within log_daily_usage_measurables task

* Use user_id instead of user, move notification title into tags
2020-07-10 12:30:45 +02:00

18 lines
505 B
Ruby

FactoryBot.define do
factory :ahoy_message, class: "Ahoy::Message" do
user
end
factory :ahoy_visit, class: "Ahoy::Visit" do
user
started_at { Timecop.freeze(Time.zone.now) }
end
factory :ahoy_event, class: "Ahoy::Event" do
user
visit { create(:ahoy_visit, user: user) } # Ahoy::Events require an Ahoy::Visit
time { Timecop.freeze(Time.zone.now) }
name { "Clicked Welcome Notification" }
properties { { title: "welcome_notification_welcome_thread" } }
end
end