Sha256: fa6d745b8cde25596e3f7a47723710aab80c49f1c65798e6ced6ceb16d91acdb

Contents?: true

Size: 680 Bytes

Versions: 2

Compression:

Stored size: 680 Bytes

Contents

require 'spec_helper'

describe LinkThumbnailer::URI do

  let(:uri)       { 'http://foo.com' }
  let(:instance)  { described_class.new(uri) }

  describe '#valid?' do

    let(:action) { instance.send(:valid?) }

    context 'when bad format' do

      before do
        instance.stub(:attribute).and_return("/invalid/path")
      end

      it { expect(action).to be_falsey }

    end

    context 'when valid format' do

      before do
        instance.stub(:attribute).and_return("http://foo.com")
      end

      it { expect(action).to be_truthy }

    end

  end

  describe '#to_s' do

    let(:action) { instance.to_s }

    it { expect(action).to eq(uri) }

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
link_thumbnailer-3.3.0 spec/uri_spec.rb
link_thumbnailer-3.2.1 spec/uri_spec.rb