Sha256: 7ade1126542853e938f8042f2a866b4a24b7cfdaebaccdb290de5afb54af82c7

Contents?: true

Size: 1.55 KB

Versions: 14

Compression:

Stored size: 1.55 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

  pending 'allows a curator to select from existing browse categories' do
    pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
    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

  pending 'allows the curator to omit document counts' do
    pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
    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

14 entries across 14 versions & 1 rubygems

Version Path
blacklight-spotlight-1.0.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.34.1 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.34.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.33.3 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.33.2 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.33.1 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.33.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.32.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.31.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.30.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.29.1 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb
blacklight-spotlight-0.29.0 spec/features/javascript/blocks/featured_browse_categories_block_spec.rb