Sha256: 5ae7d062625c987ea8afbc1c95755e6dd80403b1351372433f44301281ee1574

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe 'UtmStripper' do
  it 'should strip UTM query string params' do
    dirty_url = "http://example.com/foo?utm_campaign=123"
    clean_url = "http://example.com/foo"
    sut = Jamnagar::Utilities::UtmStripper.new
    expect(sut.strip(dirty_url)).to eq(clean_url)
  end

  it 'should strip mbid query string params' do
    dirty_url = "http://example.com/foo?mbid=social_twitter"
    clean_url = "http://example.com/foo"
    sut = Jamnagar::Utilities::UtmStripper.new
    expect(sut.strip(dirty_url)).to eq(clean_url)
  end

  it 'should strip hootPostID query string params' do
    dirty_url = "http://example.com/foo?hootPostID=9db6f9a657df03e6cc250791fe8631ac"
    clean_url = "http://example.com/foo"
    sut = Jamnagar::Utilities::UtmStripper.new
    expect(sut.strip(dirty_url)).to eq(clean_url)
  end

  it 'should leave other params alone' do
    dirty_url = "http://example.com/foo?utm_campaign=123&foo=bar"
    clean_url = "http://example.com/foo?foo=bar"
    sut = Jamnagar::Utilities::UtmStripper.new
    expect(sut.strip(dirty_url)).to eq(clean_url)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jamnagar-1.3.9.1 spec/utm_stripper_spec.rb
jamnagar-1.3.9 spec/utm_stripper_spec.rb
jamnagar-1.3.8 spec/utm_stripper_spec.rb