Sha256: 1bed0d550f7af8f507805d5b4013f2edc1af164296ba0644bfc847268f9b77e6

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true
require 'spec_helper'

describe "Alternate Controller Behaviors" do
  it "should have the correct per-page form" do
    visit search_alternate_path
    expect(page).to have_selector("form[action='#{search_alternate_url}']")
    fill_in "q", :with=>"history"
    click_button 'search'
    expect(current_path).to match /#{search_alternate_path}/
    within "#per_page-dropdown .dropdown-menu" do
      click_on '10 per page'
    end
    expect(current_path).to match /#{search_alternate_path}/
  end

  it "should have the correct search field form" do
    visit search_alternate_path
    expect(page).to have_selector("form[action='#{search_alternate_url}']")
    fill_in "q", :with=>"history"
    click_button 'search'
    expect(current_path).to match /#{search_alternate_path}/
    click_on 'relevance'
    expect(current_path).to match /#{search_alternate_path}/
  end

  it "should display document thumbnails" do
    visit search_alternate_path
    expect(page).to have_selector("form[action='#{search_alternate_url}']")
    fill_in "q", :with=>"history"
    click_button 'search'
    expect(page).to have_selector ".document-thumbnail"
    expect(page).to have_selector ".document-thumbnail a[data-context-href]"
    expect(page).to have_selector ".document-thumbnail a img"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blacklight-6.2.0 spec/features/alternate_controller_spec.rb
blacklight-6.1.0 spec/features/alternate_controller_spec.rb
blacklight-6.0.2 spec/features/alternate_controller_spec.rb
blacklight-6.0.1 spec/features/alternate_controller_spec.rb
blacklight-6.0.0 spec/features/alternate_controller_spec.rb