Sha256: 7fdbe6312ad5b6f41fa0fca75ee36f6a9e1494c64da224cd3e06c127e39d317a

Contents?: true

Size: 1.1 KB

Versions: 22

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

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

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-spotlight-0.18.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.17.1 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.17.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.16.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.15.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.14.2 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.14.1 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.14.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.13.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.12.1 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.12.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.11.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.10.3 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.10.2 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.10.1 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.10.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.9.2 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.9.1 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.9.0 spec/features/javascript/preview_block_spec.rb
blacklight-spotlight-0.8.2 spec/features/javascript/preview_block_spec.rb