Sha256: cc43299501f8b6fb74b9f6c4cc5a677954e993adf5a8a837863a40b9d176003a

Contents?: true

Size: 1.42 KB

Versions: 88

Compression:

Stored size: 1.42 KB

Contents

# frozen_string_literal: true

RSpec.describe "Search History Page" do
  describe "navigating from the homepage" do
    it "has a link to the history page" do
      visit root_path
      click_link 'History'
      expect(page).to have_content 'Search History'
      expect(page).to have_content 'You have no search history'
    end
  end

  describe "when I have done a search" do
    before do
      visit root_path
      fill_in "q", with: 'book'
      click_button 'search'
      click_link 'History'
    end

    it "shows searches" do
      expect(page).to have_content 'Your recent searches'
      expect(page).to have_content 'book'
      expect(page).not_to have_content 'dang'
      visit root_path
      fill_in "q", with: 'dang'
      click_button 'search'
      click_link 'History'
      expect(page).to have_content 'book'
      expect(page).to have_content 'dang'
    end
  end

  describe "when i've done several searches" do
    before do
      visit root_path
      fill_in "q", with: 'book'
      click_button 'search'
      fill_in "q", with: 'dang'
      click_button 'search'
      click_link 'History'
    end

    it "is able to clear the history" do
      click_link "Clear Search History"
      expect(page).to have_content 'Cleared your search history.'
      expect(page).to have_content 'You have no search history'
      expect(page).not_to have_content 'book'
      expect(page).not_to have_content 'dang'
    end
  end
end

Version data entries

88 entries across 88 versions & 2 rubygems

Version Path
blacklight-7.40.0 spec/features/search_history_spec.rb
blacklight-7.39.0 spec/features/search_history_spec.rb
blacklight-7.38.0 spec/features/search_history_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/spec/features/search_history_spec.rb
blacklight-8.2.2 spec/features/search_history_spec.rb
blacklight-8.2.1 spec/features/search_history_spec.rb
blacklight-8.2.0 spec/features/search_history_spec.rb
blacklight-7.37.0 spec/features/search_history_spec.rb
blacklight-7.36.2 spec/features/search_history_spec.rb
blacklight-7.36.1 spec/features/search_history_spec.rb
blacklight-7.36.0 spec/features/search_history_spec.rb
blacklight-7.35.0 spec/features/search_history_spec.rb
blacklight-8.1.0 spec/features/search_history_spec.rb
blacklight-7.34.0 spec/features/search_history_spec.rb
blacklight-8.0.1 spec/features/search_history_spec.rb
blacklight-8.0.0 spec/features/search_history_spec.rb
blacklight-8.0.0.beta8 spec/features/search_history_spec.rb
blacklight-8.0.0.beta7 spec/features/search_history_spec.rb
blacklight-8.0.0.beta6 spec/features/search_history_spec.rb
blacklight-8.0.0.beta5 spec/features/search_history_spec.rb