Sha256: 937106522905ae83701feb27b840d77280764c3302e29778c28d8e878fa378a4

Contents?: true

Size: 603 Bytes

Versions: 8

Compression:

Stored size: 603 Bytes

Contents

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

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

  let :object do
    klass.new
  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.sources.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/sourceable_spec.rb
pupa-0.0.7 spec/models/concerns/sourceable_spec.rb
pupa-0.0.6 spec/models/concerns/sourceable_spec.rb
pupa-0.0.5 spec/models/concerns/sourceable_spec.rb
pupa-0.0.4 spec/models/concerns/sourceable_spec.rb
pupa-0.0.3 spec/models/concerns/sourceable_spec.rb
pupa-0.0.2 spec/models/concerns/sourceable_spec.rb
pupa-0.0.1 spec/models/concerns/sourceable_spec.rb