Skip to content

Commit

Permalink
Merge pull request #235 from tulibraries/BL-1643-add-facet-tests-for-…
Browse files Browse the repository at this point in the history
…capitalization

BL-1643 Add tests to confirm case insensitivity for facet searches
  • Loading branch information
sensei100 authored Dec 12, 2024
2 parents a64e9fb + afc0d17 commit 9d9793d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
21 changes: 21 additions & 0 deletions spec/relevance/facet_searches_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true
require "spec_helper"

RSpec.describe "Facet searches" do
solr = RSolr.connect(url: ENV["SOLR_URL"])
let(:per_page) { 10 }

field = "subject_topic_facet"
query = "Women — Netherlands — History"

let(:response_uppercase) { solr.get("search", params: { fq: "#{field}:'#{query.upcase}'", rows: per_page }) }
let(:response_lowercase) { solr.get("search", params: { fq: "#{field}:'#{query.downcase}'", rows: per_page }) }

context "facet search results are case insensitive" do
it "returns the same number of results" do
expect(response_uppercase['response']['numFound']).to eq(response_lowercase['response']['numFound'])
end
end
end


1 change: 0 additions & 1 deletion spec/relevance/format_score_search_records_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true
require "spec_helper"
require "pry"

RSpec.describe "Searches with format set to 'Score' "do
solr = RSolr.connect(url: ENV["SOLR_URL"])
Expand Down

0 comments on commit 9d9793d

Please sign in to comment.