Sha256: 9d1e7adb6130c080ee51eb9dbff2fc1f1d42c69d859790f5a9d1fc2a5bebca37

Contents?: true

Size: 644 Bytes

Versions: 51

Compression:

Stored size: 644 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).not_to 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

51 entries across 51 versions & 1 rubygems

Version Path
blacklight-7.25.1 spec/lib/blacklight/parameters_spec.rb
blacklight-7.25.0 spec/lib/blacklight/parameters_spec.rb
blacklight-7.24.0 spec/lib/blacklight/parameters_spec.rb
blacklight-7.23.0.1 spec/lib/blacklight/parameters_spec.rb
blacklight-7.23.0 spec/lib/blacklight/parameters_spec.rb
blacklight-7.22.2 spec/lib/blacklight/parameters_spec.rb
blacklight-7.22.1 spec/lib/blacklight/parameters_spec.rb
blacklight-7.22.0 spec/lib/blacklight/parameters_spec.rb
blacklight-7.21.2 spec/lib/blacklight/parameters_spec.rb
blacklight-7.21.1 spec/lib/blacklight/parameters_spec.rb
blacklight-7.21.0 spec/lib/blacklight/parameters_spec.rb
blacklight-7.20.1 spec/lib/blacklight/parameters_spec.rb
blacklight-7.20.0 spec/lib/blacklight/parameters_spec.rb
blacklight-7.19.2 spec/lib/blacklight/parameters_spec.rb
blacklight-7.19.1 spec/lib/blacklight/parameters_spec.rb
blacklight-7.19.0 spec/lib/blacklight/parameters_spec.rb
blacklight-7.18.1 spec/lib/blacklight/parameters_spec.rb
blacklight-7.18.0 spec/lib/blacklight/parameters_spec.rb
blacklight-7.17.2 spec/lib/blacklight/parameters_spec.rb
blacklight-7.17.1 spec/lib/blacklight/parameters_spec.rb