Sha256: a5a0211bcfdee2e02cf268627c00fc1252b450eae34007f7f8e8dd7f22a75bfc

Contents?: true

Size: 1.08 KB

Versions: 11

Compression:

Stored size: 1.08 KB

Contents

feature 'Block preview' do
  let(:exhibit) { FactoryGirl.create(: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

11 entries across 11 versions & 1 rubygems

Version Path
blacklight-spotlight-0.24.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.23.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.22.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.21.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.20.3 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.20.2 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.20.1 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.20.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.19.2 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.19.1 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.19.0 spec/features/javascript/preview_block_spec.rb