Sha256: bd2bbb3c5dae49979b31197b841f1d0d70e1fb8f74169856ed1f63b5c1e6fc86

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

require 'spec_helper'

describe GoogleAnalyticsMailer::UriBuilder do

  describe '#build' do

    it 'should not include blank GA params' do
      subject.build('http://www.example.com', utm_campaign: nil).should_not include 'utm_campaign'
    end

    it 'should uri encode GA parameter values' do
      subject.build('http://www.example.com', utm_campaign: 'Foo Bar').should include 'utm_campaign=Foo%20Bar'
    end

    it 'should not add GA parameters if uri is not absolute' do
      subject.build('/some/path', utm_campaign: 'abc').should == '/some/path'
    end

    it 'should not touch uri with empty params' do
      subject.build('http://www.example.com', {}).should == 'http://www.example.com'
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
google_analytics_mailer-0.2.1 spec/lib/uri_builder_spec.rb
google_analytics_mailer-0.2.0 spec/lib/uri_builder_spec.rb