Sha256: d44594dc30faa6b1274f585ec7c6dbb438c3651ccdd3866b21927b3b58c58489

Contents?: true

Size: 642 Bytes

Versions: 1

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Blacklight::Parameters do
  describe "sanitize_search_params" do
    subject { described_class.sanitize(params) }

    context "with nil values" do
      let(:params) { ActionController::Parameters.new a: nil, b: 1 }
      it "removes them" do
        expect(subject).to_not have_key(:a)
        expect(subject[:b]).to eq 1
      end
    end

    context "with blacklisted keys" do
      let(:params) { ActionController::Parameters.new action: true, controller: true, id: true, commit: true, utf8: true }
      it "removes them" do
        expect(subject).to be_empty
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-7.0.0.rc1 spec/lib/blacklight/parameters_spec.rb