Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-30 04:30:29 +01:00
23 Zeilen
626 B
Ruby
23 Zeilen
626 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require_relative '../../plugin_helper'
|
||
|
|
||
|
describe CustomWizard::NoticeSerializer do
|
||
|
before do
|
||
|
@notice = CustomWizard::Notice.new(
|
||
|
message: "Message about subscription",
|
||
|
type: "info",
|
||
|
created_at: Time.now - 3.day,
|
||
|
expired_at: nil
|
||
|
)
|
||
|
@notice.save
|
||
|
end
|
||
|
|
||
|
it 'should return notice attributes' do
|
||
|
serialized_notice = described_class.new(@notice)
|
||
|
expect(serialized_notice.message).to eq(@notice.message)
|
||
|
expect(serialized_notice.type).to eq(CustomWizard::Notice.types.key(@notice.type))
|
||
|
expect(serialized_notice.dismissable).to eq(true)
|
||
|
end
|
||
|
end
|