Sha256: 63ff33d991b30358053a54ae88346c4987fadaae5832ceaea70894e09fc2fd3f

Contents?: true

Size: 1.2 KB

Versions: 18

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

describe 'adding an item using the provided bookmarklet', type: :feature do
  let(:exhibit) { FactoryGirl.create(:exhibit) }
  let(:curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
  let(:search) { exhibit.searches.first }
  before { login_as curator }

  before do
    Spotlight::Engine.config.new_resource_partials += ['spotlight/resources/bookmarklet']
  end

  it 'has an exhibit-specific bookmarklet' do
    visit spotlight.admin_exhibit_catalog_index_path(exhibit)
    click_link 'Add repository item'

    expect(page).to have_content 'Drag this button to the bookmarks toolbar in your web browser'
    expect(page).to have_link "#{exhibit.title} - Blacklight widget"
  end

  it 'triggers the bookmarklet' do
    # magic.
  end

  it 'submits the form to create a new item' do
    allow_any_instance_of(Spotlight::Resource).to receive(:reindex_later)
    visit spotlight.new_exhibit_resource_path(exhibit, popup: true, resource: { url: 'info:url' })
    expect(page).to have_content 'Add Resource'
    expect(first('#resource_url', visible: false).value).to eq 'info:url'
    click_button 'Create Resource'
    expect(Spotlight::Resource.last.url).to eq 'info:url'
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
blacklight-spotlight-0.15.0 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.14.2 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.14.1 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.14.0 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.13.0 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.12.1 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.12.0 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.11.0 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.10.3 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.10.2 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.10.1 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.10.0 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.9.2 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.9.1 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.9.0 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.8.2 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.8.1 spec/features/add_item_bookmarklet_spec.rb
blacklight-spotlight-0.8.0 spec/features/add_item_bookmarklet_spec.rb