Does not exclude message_html from attributes

This commit is contained in:
Douglas Barbosa Alexandre 2019-03-20 15:43:40 -03:00
parent 3fd8e61271
commit bcc988a6c6
No known key found for this signature in database
GPG key ID: F1E98EF6393565A0
2 changed files with 7 additions and 1 deletions

View file

@ -4,7 +4,7 @@ class BroadcastMessage < ActiveRecord::Base
include CacheMarkdownField
include Sortable
cache_markdown_field :message, pipeline: :broadcast_message
cache_markdown_field :message, pipeline: :broadcast_message, hidden: false
validates :message, presence: true
validates :starts_at, presence: true

View file

@ -95,6 +95,12 @@ describe BroadcastMessage do
end
end
describe '#attributes' do
it 'includes message_html field' do
expect(subject.attributes.keys).to include("cached_markdown_version", "message_html")
end
end
describe '#active?' do
it 'is truthy when started and not ended' do
message = build(:broadcast_message)