Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
FIX: failing log spec
Dieser Commit ist enthalten in:
Ursprung
32a8dcf19f
Commit
caab850127
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
|
@ -15,13 +15,13 @@ class CustomWizard::Log
|
||||||
@username = attrs['username']
|
@username = attrs['username']
|
||||||
end
|
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)
|
log_id = SecureRandom.hex(12)
|
||||||
|
|
||||||
PluginStore.set('custom_wizard_log',
|
PluginStore.set('custom_wizard_log',
|
||||||
log_id.to_s,
|
log_id.to_s,
|
||||||
{
|
{
|
||||||
date: Time.now,
|
date: date,
|
||||||
wizard_id: wizard_id,
|
wizard_id: wizard_id,
|
||||||
action: action,
|
action: action,
|
||||||
username: username,
|
username: username,
|
||||||
|
|
|
@ -4,7 +4,7 @@ describe CustomWizard::LogSerializer do
|
||||||
fab!(:user) { Fabricate(:user) }
|
fab!(:user) { Fabricate(:user) }
|
||||||
|
|
||||||
it 'should return log attributes' do
|
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')
|
CustomWizard::Log.create('second-test-wizard', 'perform_second_action', 'second_test_user', 'Second log message')
|
||||||
|
|
||||||
json_array = ActiveModel::ArraySerializer.new(
|
json_array = ActiveModel::ArraySerializer.new(
|
||||||
|
|
Laden …
In neuem Issue referenzieren