-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d7082d
commit 21c232f
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script type="application/ld+json"> | ||
{ | ||
"@context": "http://schema.org", | ||
"@type": "WebSite", | ||
"url": "<%= root_url %>", | ||
"potentialAction": { | ||
"@type": "SearchAction", | ||
"target": "<%= root_url %>?q={search_term_string}", | ||
"query-input": "required name=search_term_string" | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'spec_helper' | ||
|
||
feature 'Sitelinks search box' do | ||
scenario 'is home page' do | ||
visit root_path | ||
expect(page).to have_css 'script[type="application/ld+json"]' | ||
end | ||
scenario 'on search page' do | ||
visit catalog_index_path q: 'book' | ||
expect(page).to_not have_css 'script[type="application/ld+json"]' | ||
end | ||
end |
21c232f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://developers.google.com/structured-data/slsb-overview