Sha256: ff7ade7312ce390a7f09f9d297577573ecb3f401c1de5cfa639b3d1f49c52b65

Contents?: true

Size: 1.59 KB

Versions: 14

Compression:

Stored size: 1.59 KB

Contents

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

  let(:exhibit_curator) { FactoryGirl.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

14 entries across 14 versions & 1 rubygems

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