Sha256: 14d2fe6218bb300d4c83f2e43fd33178dfd50695d73aa01f57b696f755dabf98

Contents?: true

Size: 625 Bytes

Versions: 14

Compression:

Stored size: 625 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_false }

    end

    context 'when image url is not blacklisted' do

      let(:blacklist_urls) { [] }

      it { expect(action).to be_true }

    end

  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
link_thumbnailer-2.4.0 spec/image_validator_spec.rb
link_thumbnailer-2.3.2 spec/image_validator_spec.rb
link_thumbnailer-2.3.1 spec/image_validator_spec.rb
link_thumbnailer-2.3.0 spec/image_validator_spec.rb
link_thumbnailer-2.2.3 spec/image_validator_spec.rb
link_thumbnailer-2.2.2 spec/image_validator_spec.rb
link_thumbnailer-2.2.1 spec/image_validator_spec.rb
link_thumbnailer-2.2.0 spec/image_validator_spec.rb
link_thumbnailer-2.1.0 spec/image_validator_spec.rb
link_thumbnailer-2.0.4 spec/image_validator_spec.rb
link_thumbnailer-2.0.3 spec/image_validator_spec.rb
link_thumbnailer-2.0.2 spec/image_validator_spec.rb
link_thumbnailer-2.0.1 spec/image_validator_spec.rb
link_thumbnailer-2.0.0 spec/image_validator_spec.rb