Sha256: 050d3824485caa48bbecdb52c5cab1bb7edab660114decf84232ec9def0f78d9

Contents?: true

Size: 446 Bytes

Versions: 30

Compression:

Stored size: 446 Bytes

Contents

require_relative "../spec_helper"

describe "unescape_path_path plugin" do 
  it "decodes URL-encoded routing path" do
    app(:unescape_path) do |r|
      r.on 'b' do
        r.get(/(.)/) do |a|
          "#{a}-b"
        end
      end

      r.get :name do |name|
        name
      end
    end

    body('/a').must_equal 'a'
    body('/%61').must_equal 'a'
    body('%2f%61').must_equal 'a'
    body('%2f%62%2f%61').must_equal 'a-b'
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
roda-3.28.0 spec/plugin/unescape_path_spec.rb
roda-3.27.0 spec/plugin/unescape_path_spec.rb
roda-3.26.0 spec/plugin/unescape_path_spec.rb
roda-3.25.0 spec/plugin/unescape_path_spec.rb
roda-3.24.0 spec/plugin/unescape_path_spec.rb
roda-3.23.0 spec/plugin/unescape_path_spec.rb
roda-3.22.0 spec/plugin/unescape_path_spec.rb
roda-3.21.0 spec/plugin/unescape_path_spec.rb
roda-3.20.0 spec/plugin/unescape_path_spec.rb
roda-3.19.0 spec/plugin/unescape_path_spec.rb
roda-3.18.0 spec/plugin/unescape_path_spec.rb
roda-3.17.0 spec/plugin/unescape_path_spec.rb
roda-3.16.0 spec/plugin/unescape_path_spec.rb
roda-3.15.0 spec/plugin/unescape_path_spec.rb
roda-3.14.1 spec/plugin/unescape_path_spec.rb
roda-3.14.0 spec/plugin/unescape_path_spec.rb
roda-3.13.0 spec/plugin/unescape_path_spec.rb
roda-3.12.0 spec/plugin/unescape_path_spec.rb
roda-3.11.0 spec/plugin/unescape_path_spec.rb
roda-3.10.0 spec/plugin/unescape_path_spec.rb