docbrown/spec/system/search/search_title_spec.rb
Lawrence 1b32e9a8e3
Hero Billboard Placement (#19467)
* init

* add option to swagger docs

* in_house validation

* filtered ad quesry changes

* styling and prioritizing home hero banner over campaign banner

* rubocop

* typo

* broken spec

* more spec fixes

* found the spec break culprit

* derp

* Update app/views/shared/_display_ad.html.erb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Update app/controllers/stories_controller.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* remove immediate return

* styling feedback and moving banner to articles index

* remove nil

* updated styling

* add signed in bool

* add feature flag

* remove feature flag data scripts

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-05-18 12:37:32 -05:00

27 lines
772 B
Ruby

require "rails_helper"
RSpec.describe "Search page title" do
let!(:current_user) { create(:user) }
before do
sign_in current_user
end
context "when search query param exists" do
it "includes the search term in title and heading" do
visit "/search?q=helloworld"
expect(page).to have_title("Search Results for helloworld - DEV(local)")
expect(page.find("h1.crayons-title")).to have_content("Search results for helloworld")
end
end
context "when search query param doesn't exist" do
it "does not include search term in title and heading" do
visit "/search"
expect(page).to have_title("Search Results - DEV(local)")
expect(page.find("h1.crayons-title")).to have_content("Search results")
end
end
end