Sha256: 4465f0deee4fbdc1aeb62defc6c2986ac726dbc81e486da179957a3b93681195

Contents?: true

Size: 402 Bytes

Versions: 17

Compression:

Stored size: 402 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__)))

describe "indifferent_params plugin" do 
  it "allows indifferent access to request params via params method" do
    app(:indifferent_params) do |r|
      r.on do
        "#{params[:a]}/#{params[:b][0][:c]}"
      end
    end

    body('QUERY_STRING'=>'a=2&b[][c]=3', 'rack.input'=>StringIO.new).must_equal '2/3'
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
roda-2.18.0 spec/plugin/indifferent_params_spec.rb
roda-2.17.0 spec/plugin/indifferent_params_spec.rb
roda-2.16.0 spec/plugin/indifferent_params_spec.rb
roda-2.15.0 spec/plugin/indifferent_params_spec.rb
roda-2.14.0 spec/plugin/indifferent_params_spec.rb
roda-2.13.0 spec/plugin/indifferent_params_spec.rb
roda-2.12.0 spec/plugin/indifferent_params_spec.rb
roda-2.11.0 spec/plugin/indifferent_params_spec.rb
roda-2.10.0 spec/plugin/indifferent_params_spec.rb
roda-2.9.0 spec/plugin/indifferent_params_spec.rb
roda-2.8.0 spec/plugin/indifferent_params_spec.rb
roda-2.7.0 spec/plugin/indifferent_params_spec.rb
roda-2.6.0 spec/plugin/indifferent_params_spec.rb
roda-2.5.1 spec/plugin/indifferent_params_spec.rb
roda-2.5.0 spec/plugin/indifferent_params_spec.rb
roda-2.4.0 spec/plugin/indifferent_params_spec.rb
roda-2.3.0 spec/plugin/indifferent_params_spec.rb