* Add basic tests for Analytics service * User/Organization are always required * Add some data to the test * Use queries and date times * Fix AnalyticsService interface in the controller * s/HTTP_API_KEY/api-key * Defend against nils and support datetime objects * Update app/services/analytics_service.rb Co-Authored-By: rhymes <rhymesete@gmail.com> * Use SQL sum, not Rails sum * Group average_read_time * Use SQL, not Rails * Use ISO date * Fix specs
6 lines
76 B
Ruby
6 lines
76 B
Ruby
FactoryBot.define do
|
|
factory :page_view do
|
|
user
|
|
article
|
|
end
|
|
end
|