Sha256: 6669814b39ed60bb7832672e69715a523a61538b119a2dcb791ec63e753e79ff

Contents?: true

Size: 627 Bytes

Versions: 18

Compression:

Stored size: 627 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

18 entries across 18 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.alpha.2 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.1 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.13.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.12.1 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.12.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.11.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.10.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.9.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.8.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.7.2 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.7.1 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.7.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.6.1.1 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.6.1 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.6.0 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.5.2 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.5.1 spec/views/shared/_analytics.html.erb_spec.rb
blacklight-spotlight-2.5.0 spec/views/shared/_analytics.html.erb_spec.rb