discourse/plugins/discourse-rewind/spec/plugin_helper.rb
Martin Brennan 95bb1bdf30
FEATURE: Bundle discourse-rewind plugin in core (#36409)
We think this is in a good place to move into core
and prepare for a wider release after the additional
work that has been done this year.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Kris Aubuchon <kris.aubuchon@discourse.org>
Co-authored-by: Rafael dos Santos Silva <xfalcox@gmail.com>
2025-12-08 11:38:48 +10:00

15 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 }