Sha256: b2e36b81d9071f6daac0d860e9c7ec5daeefec38ad495c8cf96af8b04a0c2510

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

feature 'Block preview' do
  let(:exhibit) { FactoryGirl.create(:default_exhibit) }
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
  let(:feature_page) do
    FactoryGirl.create(
      :feature_page,
      title: 'FeaturePage1',
      exhibit: exhibit
    )
  end

  before do
    login_as exhibit_curator
    visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)
  end

  scenario 'should allow you to preview a widget', js: true do
    add_widget 'solr_documents'
    fill_in_typeahead_field with: 'dq287tq6352'

    # display the title as the primary caption
    within('.primary-caption') do
      check('Primary caption')
      select('Title', from: 'primary-caption-field')
    end

    # Preview page
    find('a[data-icon="preview"]').trigger('click')
    # verify that the page was previewed
    expect(page).to have_css('.preview')
    # verify that the item + image widget is displaying an image from the document.
    within(:css, '.preview') do
      expect(page).to have_css 'img'
      expect(page).to have_content "L'AMERIQUE"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blacklight-spotlight-0.7.2 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.7.1 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.7.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.6.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.5.0 spec/features/javascript/preview_block_spec.rb