Sha256: 00efbfa19484d67fd416666d63ef5e0212134928ecce5ce97c5bc1f185262cc3

Contents?: true

Size: 598 Bytes

Versions: 20

Compression:

Stored size: 598 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Hyperdrive::Middleware::SanitizeParams do
  before do
    @env = default_rack_env(default_resource)
  end

  def app
    inner_app = ->(env) { [200, {}, [env['hyperdrive.params']]] }
    Hyperdrive::Middleware::SanitizeParams.new(inner_app)
  end

  it "will sanitize filters" do
    get '/', { 'id' => '1001', 'removed' => 'me' }, @env
    last_response.body.must_equal "{:id=>\"1001\"}"
  end

  it "will sanitize params" do
    post '/', { 'id' => '1001', 'removed' => 'me' }, @env
    last_response.body.must_equal "{:id=>\"1001\"}"
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
hyperdrive-0.0.25 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.24 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.23 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.22 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.21 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.20 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.19 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.18 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.17 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.16 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.15 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.14 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.13 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.12 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.11 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.10 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.9 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.8 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.7 spec/hyperdrive/middleware/sanitize_params_spec.rb
hyperdrive-0.0.6 spec/hyperdrive/middleware/sanitize_params_spec.rb