Sha256: 7aceb815ddfeb2c67dde509756a6f52d4bf2fc27c8b94e97a4b8dfe925134b58

Contents?: true

Size: 628 Bytes

Versions: 22

Compression:

Stored size: 628 Bytes

Contents

# frozen_string_literal: true

describe 'shared/_analytics', type: :view do
  it 'is empty without Google Analytics configured' do
    render
    expect(rendered).to be_empty
  end

  it 'renders the GA script tag if the web property id is configured' do
    allow(Spotlight::Engine.config).to receive(:ga_web_property_id).and_return('XYZ-234')
    allow(Spotlight::Engine.config).to receive(:ga_anonymize_ip).and_return(true)
    render
    expect(rendered).to have_selector 'script', visible: false
    expect(rendered).to have_content 'XYZ-234'
    expect(rendered).to have_content "ga('set', 'anonymizeIp', true)"
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-spotlight-3.4.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.3.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.2.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.1.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.3 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.2 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.1 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/views/shared/_analytics.html.erb_spec.rb