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