Sha256: be485820775d397d0c30986a399fe9be4f5743bbbecd72b2156e1c81d318bd06

Contents?: true

Size: 1006 Bytes

Versions: 24

Compression:

Stored size: 1006 Bytes

Contents

# frozen_string_literal: true

describe 'spotlight/dashboards/analytics.html.erb', type: :view do
  let(:current_exhibit) { FactoryBot.create(:exhibit) }

  before do
    allow(view).to receive_messages(current_exhibit: current_exhibit, exhibit_root_path: '/some/path')
  end

  it 'has a header' do
    render
    expect(rendered).to have_selector '.page-header', text: 'Curation'
    expect(rendered).to have_selector '.page-header small', text: 'Analytics'
  end

  it 'has directions for configuring analytics' do
    render
    expect(rendered).to have_link 'configure an analytics provider'
  end

  context 'with a configured analytics integration' do
    before do
      allow(current_exhibit).to receive(:analytics_provider).and_return(double(Spotlight::Analytics::Ga, enabled?: true))
      stub_template 'spotlight/dashboards/_analytics.html.erb' => 'Analytics data'
    end

    it 'has analytics data' do
      render

      expect(rendered).to have_content 'Analytics data'
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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