1
0
Fork 0

Merge pull request #245 from paviliondev/log_spec_fix

Dieser Commit ist enthalten in:
Angus McLeod 2023-05-02 08:51:27 +02:00 committet von GitHub
Commit 461e617453
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -15,13 +15,13 @@ class CustomWizard::Log
@username = attrs['username']
end
def self.create(wizard_id, action, username, message)
def self.create(wizard_id, action, username, message, date = Time.now)
log_id = SecureRandom.hex(12)
PluginStore.set('custom_wizard_log',
log_id.to_s,
{
date: Time.now,
date: date,
wizard_id: wizard_id,
action: action,
username: username,

Datei anzeigen

@ -1,7 +1,7 @@
# frozen_string_literal: true
# name: discourse-custom-wizard
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
# version: 2.3.1
# version: 2.3.2
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever
# url: https://github.com/paviliondev/discourse-custom-wizard
# contact_emails: development@pavilion.tech

Datei anzeigen

@ -4,7 +4,7 @@ describe CustomWizard::LogSerializer do
fab!(:user) { Fabricate(:user) }
it 'should return log attributes' do
CustomWizard::Log.create('first-test-wizard', 'perform_first_action', 'first_test_user', 'First log message')
CustomWizard::Log.create('first-test-wizard', 'perform_first_action', 'first_test_user', 'First log message', 1.day.ago)
CustomWizard::Log.create('second-test-wizard', 'perform_second_action', 'second_test_user', 'Second log message')
json_array = ActiveModel::ArraySerializer.new(