Sha256: 6bdcf11f18c3c271c4445a111baa7357cb63c35cb59c5b7ab7d288f4a2ea90a4

Contents?: true

Size: 628 Bytes

Versions: 15

Compression:

Stored size: 628 Bytes

Contents

require 'spec_helper'

describe LinkThumbnailer::ImageValidator do

  let(:src)       { 'http://foo.com' }
  let(:image)     { double(src: src) }
  let(:instance)  { described_class.new(image) }

  describe '#call' do

    let(:action) { instance.call }

    before do
      instance.stub(:blacklist_urls).and_return(blacklist_urls)
    end

    context 'when image url is blacklisted' do

      let(:blacklist_urls) { [src] }

      it { expect(action).to be_falsey }

    end

    context 'when image url is not blacklisted' do

      let(:blacklist_urls) { [] }

      it { expect(action).to be_truthy }

    end

  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
link_thumbnailer-3.3.0 spec/image_validator_spec.rb
link_thumbnailer-3.2.1 spec/image_validator_spec.rb
link_thumbnailer-3.2.0 spec/image_validator_spec.rb
link_thumbnailer-3.1.2 spec/image_validator_spec.rb
link_thumbnailer-3.1.1 spec/image_validator_spec.rb
link_thumbnailer-3.1.0 spec/image_validator_spec.rb
link_thumbnailer-3.0.3 spec/image_validator_spec.rb
link_thumbnailer-3.0.2 spec/image_validator_spec.rb
link_thumbnailer-3.0.1 spec/image_validator_spec.rb
link_thumbnailer-3.0.0 spec/image_validator_spec.rb
link_thumbnailer-2.6.1 spec/image_validator_spec.rb
link_thumbnailer-2.6.0 spec/image_validator_spec.rb
link_thumbnailer-2.5.2 spec/image_validator_spec.rb
link_thumbnailer-2.5.1 spec/image_validator_spec.rb
link_thumbnailer-2.5.0 spec/image_validator_spec.rb