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.33.1 spec/features/search_history_spec.rb
blacklight-8.0.0.beta4 spec/features/search_history_spec.rb
blacklight-8.0.0.beta3 spec/features/search_history_spec.rb
blacklight-8.0.0.beta2 spec/features/search_history_spec.rb
blacklight-8.0.0.beta1 spec/features/search_history_spec.rb
blacklight-7.33.0 spec/features/search_history_spec.rb
blacklight-7.32.0 spec/features/search_history_spec.rb
blacklight-7.31.0 spec/features/search_history_spec.rb
blacklight-7.30.0 spec/features/search_history_spec.rb
blacklight-7.29.0 spec/features/search_history_spec.rb
blacklight-7.28.0 spec/features/search_history_spec.rb
blacklight-7.27.1 spec/features/search_history_spec.rb
blacklight-7.27.0 spec/features/search_history_spec.rb
blacklight-7.26.1 spec/features/search_history_spec.rb
blacklight-7.26.0 spec/features/search_history_spec.rb
blacklight-7.25.3 spec/features/search_history_spec.rb
blacklight-7.25.2 spec/features/search_history_spec.rb
blacklight-7.25.1 spec/features/search_history_spec.rb
blacklight-7.25.0 spec/features/search_history_spec.rb
blacklight-7.24.0 spec/features/search_history_spec.rb