Sha256: 4c97bacc43e1509ae0e10c425fbba140855dfd40f7a5c17b7b4caf48e439abde

Contents?: true

Size: 1.31 KB

Versions: 47

Compression:

Stored size: 1.31 KB

Contents

describe 'spotlight/pages/index.html.erb', type: :view do
  let(:pages) do
    [
      stub_model(Spotlight::FeaturePage,
                 title: 'Title1',
                 content: '[]',
                 exhibit: exhibit),
      stub_model(Spotlight::FeaturePage,
                 title: 'Title2',
                 content: '[]',
                 exhibit: exhibit)
    ]
  end
  let(:exhibit) { stub_model(Spotlight::Exhibit) }
  before do
    allow(view).to receive(:page_collection_name).and_return(:feature_pages)
    allow(view).to receive(:update_all_exhibit_feature_pages_path).and_return('/exhibit/features/update_all')
    assign(:page, Spotlight::FeaturePage.new)
    assign(:exhibit, exhibit)
    allow(view).to receive(:current_exhibit).and_return(exhibit)
  end

  it 'renders a list of pages' do
    assign(:pages, pages)
    allow(exhibit).to receive(:feature_pages).and_return pages
    render
    expect(rendered).to have_selector '.panel-title', text: 'Title1'
    expect(rendered).to have_selector '.panel-title', text: 'Title2'
  end

  describe 'Without pages' do
    it 'does not disable the update button' do
      assign(:pages, [])
      render
      expect(rendered).not_to have_selector 'button[disabled]', text: 'Save changes'
      expect(rendered).to have_selector 'button', text: 'Save changes'
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
blacklight-spotlight-2.0.2 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-2.0.1 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-2.0.0 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-1.5.1 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-1.4.1 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-1.4.0 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-1.3.0 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-1.2.0 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-1.1.0 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-1.0.0 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-0.34.1 spec/views/spotlight/pages/index.html.erb_spec.rb
blacklight-spotlight-0.34.0 spec/views/spotlight/pages/index.html.erb_spec.rb