spec/models/concerns/contactable_spec.rb in pupa-0.0.9 vs spec/models/concerns/contactable_spec.rb in pupa-0.0.10
- old
+ new
@@ -10,9 +10,21 @@
let :object do
klass.new
end
+ describe '#initialize' do
+ it 'should initialize an empty ContactDetailList' do
+ object.contact_details.should be_a(Pupa::ContactDetailList)
+ object.contact_details.should == []
+ end
+
+ it 'should initialize the given ContactDetailList' do
+ object = klass.new(contact_details: [{type: 'email', value: 'ceo@example.com', note: 'work'}])
+ object.contact_details.should == [{type: 'email', value: 'ceo@example.com', note: 'work'}]
+ end
+ end
+
describe '#contact_details=' do
it 'should use coerce to a ContactDetailList' do
object.contact_details = [{type: 'email', value: 'ceo@example.com', note: 'work'}]
object.contact_details.should be_a(Pupa::ContactDetailList)
end