Sha256: 8a71e592bcef1072eab88efe3c8df9cb80719659a38973bba9d2473ec7a5ffde

Contents?: true

Size: 954 Bytes

Versions: 20

Compression:

Stored size: 954 Bytes

Contents

require 'spec_helper'

describe 'spotlight/dashboards/analytics.html.erb', type: :view do
  let(:current_exhibit) { FactoryGirl.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

20 entries across 20 versions & 1 rubygems

Version Path
blacklight-spotlight-0.19.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.18.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.17.1 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.17.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.16.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.15.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.14.2 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.14.1 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.14.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.13.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.12.1 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.12.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.11.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.10.3 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.10.2 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.10.1 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.10.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.9.2 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.9.1 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb
blacklight-spotlight-0.9.0 spec/views/spotlight/dashboards/analytics.html.erb_spec.rb