Sha256: 3f761ea8759c359709691b6206378c507320dab3a202ab8b53bb2cc13772b61f

Contents?: true

Size: 585 Bytes

Versions: 8

Compression:

Stored size: 585 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe Pupa::Concerns::Linkable do
  let :klass do
    Class.new(Pupa::Base) do
      include Pupa::Concerns::Linkable
    end
  end

  let :object do
    klass.new
  end

  describe '#add_link' do
    it 'should add a link' do
      object.add_link('http://example.com', note: 'homepage')
      object.links.should == [{url: 'http://example.com', note: 'homepage'}]
    end

    it 'should not add a link without a url' do
      object.add_link(nil)
      object.links.blank?.should == true
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pupa-0.0.8 spec/models/concerns/linkable_spec.rb
pupa-0.0.7 spec/models/concerns/linkable_spec.rb
pupa-0.0.6 spec/models/concerns/linkable_spec.rb
pupa-0.0.5 spec/models/concerns/linkable_spec.rb
pupa-0.0.4 spec/models/concerns/linkable_spec.rb
pupa-0.0.3 spec/models/concerns/linkable_spec.rb
pupa-0.0.2 spec/models/concerns/linkable_spec.rb
pupa-0.0.1 spec/models/concerns/linkable_spec.rb