Sha256: eb1427b00c90e4636dd4bf480bfceff1917ebdec28c97fc8c6e505a8334b9fd6

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 Bytes

Contents

require 'spec_helper'

describe Feedbook::LiquidExtensions::Filters::GooglShortenerFilter do
  
  describe '#googl' do
    before :each do
      allow(Googl).to receive(:shorten).with('https://github.com/pinoss').and_return(OpenStruct.new(short_url: 'http://goo.gl/jExQ6W'))
    end

    it 'converts given link into shorten form by Googl API service' do
      class TestClass
        include Feedbook::LiquidExtensions::Filters::GooglShortenerFilter
      end

      expect(TestClass.new.googl('https://github.com/pinoss')).to eq('http://goo.gl/jExQ6W')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
feedbook-1.1.0 spec/unit/lib/liquid_extensions/filters/googl_shortener_filter_spec.rb
feedbook-1.0.0 spec/unit/lib/liquid_extensions/filters/googl_shortener_filter_spec.rb