spec/models/concerns/sourceable_spec.rb in pupa-0.0.10 vs spec/models/concerns/sourceable_spec.rb in pupa-0.0.11

- old
+ new

@@ -10,17 +10,25 @@ let :object do klass.new end + describe '#sources' do + it 'should symbolize keys' do + object.sources = [{'url' => 'http://example.com', 'note' => 'homepage'}] + object.sources.should == [{url: 'http://example.com', note: 'homepage'}] + end + end + describe '#add_source' do it 'should add a source' do object.add_source('http://example.com', note: 'homepage') object.sources.should == [{url: 'http://example.com', note: 'homepage'}] end it 'should not add a source without a url' do object.add_source(nil) + object.add_source('') object.sources.blank?.should == true end end end