Sha256: c2ae66325bbd44978e09e0916cf768f6370193b9b9f66e6885591deabbe81935

Contents?: true

Size: 1.36 KB

Versions: 18

Compression:

Stored size: 1.36 KB

Contents

describe 'Featured Browse Category Block', type: :feature, js: true do
  let(:exhibit) { FactoryGirl.create(:exhibit) }
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }

  let!(:feature_page) { FactoryGirl.create(:feature_page, exhibit: exhibit) }
  let!(:search1) { FactoryGirl.create(:published_search, exhibit: exhibit, title: 'Title1', published: true) }
  let!(:search2) { FactoryGirl.create(:published_search, exhibit: exhibit, title: 'Title2', published: true) }

  before do
    login_as exhibit_curator

    visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)
    add_widget 'browse'
  end

  it 'allows a curator to select from existing browse categories' do
    check 'Include item counts?'

    fill_in_typeahead_field with: 'Title1'

    within(:css, '.panel') do
      uncheck 'Display?'
    end

    fill_in_typeahead_field with: 'Title2'

    save_page

    # Documents should exist
    expect(page).not_to have_css('.category-title', text: search1.title)
    expect(page).to have_css('.category-title', text: search2.title)
    expect(page).to have_css('.item-count', text: /\d+ items/i)
  end

  it 'allows the curator to omit document counts' do
    uncheck 'Include item counts?'
    fill_in_typeahead_field with: 'Title1'
    save_page

    expect(page).not_to have_css('.item-count', text: /\d+ items/i)
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
blacklight-spotlight-0.28.3 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.28.2 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.28.1 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.28.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.27.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.26.1 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.26.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.25.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.24.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.23.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.22.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.21.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.20.3 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.20.2 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.20.1 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.20.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.19.2 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.19.1 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb