spec/models/blacklight/solr/search_builder_spec.rb in blacklight-7.11.1 vs spec/models/blacklight/solr/search_builder_spec.rb in blacklight-7.12.0

- old
+ new

@@ -329,9 +329,17 @@ it "passes them through" do expect(subject[:sort]).to eq 'title_si asc, pub_date_si desc' end end + context "when the user provides a valid customized sort parmeter" do + let(:user_params) { { sort: 'year-desc' } } + + it "passes solr sort paramters through" do + expect(subject[:sort]).to eq 'pub_date_si desc, title_si asc' + end + end + context "when the user provides an invalid sort parameter" do let(:user_params) { { sort: 'bad' } } it "removes them" do expect(subject).not_to have_key(:sort)