Sha256: 1c42e9a5fb256b74be0a52d291d0d69410593681d5cec6afbb951a207154dd66

Contents?: true

Size: 790 Bytes

Versions: 3

Compression:

Stored size: 790 Bytes

Contents

require 'trade_tracker'

describe TradeTracker::Concerns::Click do
  include described_class

  describe '#send_click_to_tradetracker' do
    let(:click) { TradeTracker::Click.new(tt: '14986_12_157365_') }

    before do
      allow(self).to receive(:tradetracker_click) { click }
      allow(self).to receive(:redirect_to)
    end

    it 'redirects to a tradetracker URL by default' do
      expect(self).to receive(:redirect_to).with('https://tc.tradetracker.net/?c=14986&m=12&a=157365&r=&u=', {})
      send_click_to_tradetracker
    end

    it 'passes redirect_options parameter to redirect_to' do
      expect(self).to receive(:redirect_to).with('https://tc.tradetracker.net/?c=14986&m=12&a=157365&r=&u=', status: 301)
      send_click_to_tradetracker(status: 301)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trade_tracker-0.2.3 spec/lib/trade_tracker/concerns/click_spec.rb
trade_tracker-0.2.2 spec/lib/trade_tracker/concerns/click_spec.rb
trade_tracker-0.2.1 spec/lib/trade_tracker/concerns/click_spec.rb