Sha256: 520e9ed2732c03d8dd80b7435ccd4ccc43206b5a47b8b02c8e04ec68ab1cb39b

Contents?: true

Size: 529 Bytes

Versions: 7

Compression:

Stored size: 529 Bytes

Contents

require 'spec_helper'

describe Locomotive::Steam::Liquid::Tags::GoogleAnalytics do

  let(:source) { "{% google_analytics 42 %}" }

  subject { render_template(source) }

  it { is_expected.to include %{<script async src="https://www.googletagmanager.com/gtag/js?id=42"></script>} }
  it { is_expected.to include "gtag('config', '42');" }

  describe 'raises an error if the syntax is incorrect' do
    let(:source) { '{% google_analytics %}' }
    it { expect { subject }.to raise_exception(::Liquid::SyntaxError) }
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
locomotivecms_steam-1.5.0.rc0 spec/unit/liquid/tags/google_analytics_spec.rb
locomotivecms_steam-1.5.0.beta3 spec/unit/liquid/tags/google_analytics_spec.rb
locomotivecms_steam-1.5.0.beta2 spec/unit/liquid/tags/google_analytics_spec.rb
locomotivecms_steam-1.5.0.beta1 spec/unit/liquid/tags/google_analytics_spec.rb
locomotivecms_steam-1.4.1 spec/unit/liquid/tags/google_analytics_spec.rb
locomotivecms_steam-1.4.0 spec/unit/liquid/tags/google_analytics_spec.rb
locomotivecms_steam-1.4.0.rc2 spec/unit/liquid/tags/google_analytics_spec.rb