mirror of
https://github.com/discourse/discourse-rewind.git
synced 2025-12-12 18:33:30 +00:00
Add specs for the following reports: * Reading time * Activity calendar * Best posts * Best topics * Top words * Most viewed tags * Most viewed categories Did some minor UI and ruby refactors for related components. Also made a minor change to the Activity calendar, to show a title based on the number of posts or if the user was active on hover. Still missing specs for: * Reactions * FBFF And the newly added reports that don't yet have UI components.
16 lines
460 B
Ruby
16 lines
460 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscourseRewindSpecHelper
|
|
def call_report
|
|
# user + date should be defined via fab! in the spec
|
|
described_class.call(user:, date:, guardian: user.guardian)
|
|
end
|
|
|
|
def random_datetime
|
|
# date should be defined via fab! in the spec
|
|
date.to_a.sample.to_datetime + rand(0..23).hours + rand(0..59).minutes + rand(0..59).seconds
|
|
end
|
|
end
|
|
|
|
RSpec.configure { |config| config.include DiscourseRewindSpecHelper }
|