Sha256: 878cde87305a9172c601926e35068e4e7563d5fd3bbe137e2a0fff30894dadc6

Contents?: true

Size: 930 Bytes

Versions: 9

Compression:

Stored size: 930 Bytes

Contents

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(Spotlight::Analytics::Ga).to receive(:enabled?).and_return(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

9 entries across 9 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-2.4.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-2.3.3 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-2.3.2 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-2.3.1 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-2.3.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-2.2.1 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-2.2.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-2.1.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb