Sha256: 87ff353ed7d7271212bc3dd65b23a33354fc8451682ed6eac35cff6972cf1f41

Contents?: true

Size: 901 Bytes

Versions: 32

Compression:

Stored size: 901 Bytes

Contents

describe 'spotlight/about_pages/_sidebar.html.erb', type: :view do
  let(:exhibit) { FactoryGirl.create(:exhibit) }
  let!(:page1) { FactoryGirl.create(:about_page, title: 'One', weight: 4, exhibit: exhibit) }
  let!(:page2) { FactoryGirl.create(:about_page, exhibit: exhibit, title: 'Two', published: false) }
  let!(:page3) { FactoryGirl.create(:about_page, exhibit: exhibit, title: 'Three', weight: 3) }

  before do
    allow(view).to receive_messages(current_exhibit: exhibit)
    allow(view).to receive_messages(exhibit_about_page_path: '/about/9')
  end

  it 'renders a list of pages' do
    render
    # Checking that they are sorted accoding to weight
    expect(rendered).to have_selector '#sidebar ul.sidenav li:nth-child(1) a', text: 'Three'
    expect(rendered).to have_selector '#sidebar ul.sidenav li:nth-child(2) a', text: 'One'
    expect(rendered).not_to have_link 'Two'
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
blacklight-spotlight-1.0.0 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.34.1 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.34.0 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.33.3 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.33.2 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.33.1 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.33.0 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.32.0 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.31.0 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.30.0 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.29.1 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.29.0 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.28.3 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.28.2 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.28.1 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.28.0 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.27.0 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb
blacklight-spotlight-0.26.1 spec/views/spotlight/about_pages/_sidebar.html.erb_spec.rb