Sha256: 38bb7e005214e1d9c1541233c0654b9a32b3b41ad2c9e1298e15d0c514034821

Contents?: true

Size: 1.68 KB

Versions: 22

Compression:

Stored size: 1.68 KB

Contents

# frozen_string_literal: true

describe 'About page', type: :feature, versioning: true do
  let(:exhibit) { FactoryBot.create(:exhibit) }
  let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
  let!(:about_page1) { FactoryBot.create(:about_page, title: 'First Page', exhibit: exhibit) }
  let!(:about_page2) { FactoryBot.create(:about_page, title: 'Second Page', exhibit: exhibit) }
  let(:unpublished_page) { FactoryBot.create(:about_page, title: 'Unpublished Page', published: false, exhibit: exhibit) }

  describe 'sidebar' do
    it 'displays' do
      visit spotlight.exhibit_about_page_path(about_page1.exhibit, about_page1)
      # the sidebar should display
      within('#sidebar') do
        # within the sidebar navigation
        within('ul.sidenav') do
          # the current page should be active
          expect(page).to have_css('li.active', text: about_page1.title)
          # the other page should be linked
          expect(page).to have_css('li a', text: about_page2.title)
        end
      end
    end
  end

  describe 'page options' do
    before { login_as exhibit_curator }

    describe 'publish' do
      it 'is updatable from the edit page' do
        expect(unpublished_page).not_to be_published

        visit spotlight.edit_exhibit_about_page_path(unpublished_page.exhibit, unpublished_page)
        expect(find('#about_page_published')).not_to be_checked

        check 'Publish'
        click_button 'Save changes'

        expect(unpublished_page.reload).to be_published

        visit spotlight.edit_exhibit_about_page_path(unpublished_page.exhibit, unpublished_page)
        expect(find('#about_page_published')).to be_checked
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

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