1
0
Fork 0
discourse-custom-wizard-unl.../spec/serializers/custom_wizard/notice_serializer_spec.rb
angusmcleod 084c6f4a7a wip
2021-09-24 17:58:42 +08:00

22 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