Skip to content

Commit

Permalink
Cleanup search spec
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan committed Aug 24, 2017
1 parent f5f3dc1 commit 17a4250
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions spec/features/search_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'rails_helper'

feature 'Search' do
feature 'spelling suggestions' do
feature 'Spelling suggestions' do
scenario 'are turned on' do
visit root_path
fill_in 'q', with: 'prince'
Expand All @@ -10,7 +10,7 @@
end
end

feature 'date range' do
feature 'Date range' do
scenario 'limits search results' do
visit '/?q='
fill_in 'range_solr_year_i_begin', with: '1778'
Expand All @@ -20,40 +20,40 @@
end
end

scenario 'Suppressed records are hidden' do
visit '/?q=Sanborn+Map+Company'
expect(page).to have_css '.document', count: 1
end
feature 'Suppressed records' do
scenario 'are hidden' do
visit '/?q=Sanborn+Map+Company'
expect(page).to have_css '.document', count: 1
end

scenario 'When searching child records from a parent record, supressed records are not hidden' do
visit '/?f[dct_source_sm][]=princeton-1r66j405w&q='
expect(page).to have_css '.document', count: 4
scenario 'are not hidden when searching child records from a parent record' do
visit '/?f[dct_source_sm][]=princeton-1r66j405w&q='
expect(page).to have_css '.document', count: 4
end
end

feature 'spatial search' do
scenario 'When searching using a bbox constraint, hide the coordinates' do
feature 'Constraints' do
scenario 'searching using a bbox constraint, hides the coordinates' do
visit '/catalog?bbox=-74.97447967529297%2040.237605%20-74.28783416748047%2040.446947'
expect(page).to have_css 'span.appliedFilter.constraint', count: 1
expect(page).to have_content 'Bounding Box'
expect(page).not_to have_content '-74.97447967529297 40.237605 -74.28783416748047 40.446947'
end
end

scenario 'When searching, link the thumbnails in the results to the items' do
visit '/?q='
expect(page).to have_css '.document .row .thumbnail a'
expect(first('.document .row .thumbnail a')[:href]).to include('/catalog/')
end

feature 'constraints' do
scenario 'when searching with an empty query parameter' do
scenario 'searching with an empty query parameter' do
visit '/?utf8=true&search_field=all_fields&q='
expect(page).not_to have_content('You searched for')
expect(page).not_to have_content('APPLIED FILTERS')
end

scenario 'collection facet is hidden' do
visit '/?f[dct_provenance_s][]=NYU&q='
expect(page).not_to have_content 'Bytes of the Big Apple'
end
end

scenario 'When a user searches, collection facet is hidden' do
visit '/?f[dct_provenance_s][]=NYU&q='
expect(page).not_to have_content 'Bytes of the Big Apple'
scenario 'thumbnails in the results link to the items' do
visit '/?q='
expect(page).to have_css '.document .row .thumbnail a'
expect(first('.document .row .thumbnail a')[:href]).to include('/catalog/')
end
end

0 comments on commit 17a4250

Please sign in to comment.