Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 17:30:29 +01:00
17 Zeilen
510 B
Ruby
17 Zeilen
510 B
Ruby
# frozen_string_literal: true
|
|
|
|
describe CustomWizard::LogSerializer do
|
|
fab!(:user) { Fabricate(:user) }
|
|
|
|
it 'should return log attributes' do
|
|
CustomWizard::Log.create("First log message")
|
|
CustomWizard::Log.create("Second log message")
|
|
|
|
json_array = ActiveModel::ArraySerializer.new(
|
|
CustomWizard::Log.list(0),
|
|
each_serializer: CustomWizard::LogSerializer
|
|
).as_json
|
|
expect(json_array.length).to eq(2)
|
|
expect(json_array[0][:message]).to eq("Second log message")
|
|
end
|
|
end
|