Sha256: 7c42ba82c5acfa7b282ca92e435ec10f44527fb519294bc7bef7225371d01a4f

Contents?: true

Size: 1.59 KB

Versions: 15

Compression:

Stored size: 1.59 KB

Contents

describe 'Featured Pages Blocks', type: :feature, js: true do
  let(:exhibit) { FactoryBot.create(:exhibit) }
  let!(:feature_page1) do
    FactoryBot.create(
      :feature_page,
      title: 'FeaturePage1 Title',
      weight: 1,
      exhibit: exhibit
    )
  end
  let!(:feature_page2) do
    FactoryBot.create(
      :feature_page,
      title: 'FeaturePage2 Title',
      weight: 0,
      exhibit: exhibit
    )
  end

  let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }

  before do
    login_as exhibit_curator
  end

  pending 'saves the selected exhibits' do
    pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
    visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)

    click_link('Edit')

    add_widget 'featured_pages'

    fill_in_typeahead_field with: feature_page2.title

    save_page

    expect(page).to have_content feature_page2.title
  end

  pending 'persists the user selected sort order' do
    pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
    visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)

    click_link('Edit')

    add_widget 'featured_pages'

    fill_in_typeahead_field with: feature_page1.title
    fill_in_typeahead_field with: feature_page2.title

    save_page

    feature_page1_position = page.body =~ /<p class="category-title">\s+#{feature_page1.title}/
    feature_page2_position = page.body =~ /<p class="category-title">\s+#{feature_page2.title}/

    expect(feature_page1_position).to be < feature_page2_position
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
blacklight-spotlight-2.0.2 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.0.1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.0.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-1.5.1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-1.4.1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-1.4.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-1.3.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-1.2.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-1.1.0 spec/features/javascript/blocks/featured_pages_block_spec.rb