Sha256: d43dfa70b329631654a5c3a183668bec62540c17dde04e87857f2cf03603ee4a
Contents?: true
Size: 944 Bytes
Versions: 18
Compression:
Stored size: 944 Bytes
Contents
# frozen_string_literal: true describe Spotlight::Contact, type: :model do let(:exhibit) { FactoryBot.create(:exhibit) } before do subject.exhibit = exhibit end context '#show_in_sidebar' do it 'is an attribute' do subject.show_in_sidebar = false subject.save expect(subject.show_in_sidebar).to be_falsey end it 'is published by default' do subject.save expect(subject.show_in_sidebar).to be_truthy end end context '#fields' do it 'show allow new fields to be configured' do expect(subject.class.fields).to_not have_key(:new_field) described_class.fields[:new_field] = {} expect(subject.class.fields).to have_key(:new_field) end end describe '#contact_info' do it 'persisted symbolized keys' do subject.contact_info = { 'some' => 'value' } subject.save expect(subject.contact_info).to include some: 'value' end end end
Version data entries
18 entries across 18 versions & 1 rubygems