Sha256: e9507f9249b1de2b203f7797fde464b1813cd523290a19749799acd067b64003

Contents?: true

Size: 490 Bytes

Versions: 9

Compression:

Stored size: 490 Bytes

Contents

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

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

9 entries across 9 versions & 1 rubygems

Version Path
roda-2.29.0 spec/plugin/unescape_path_spec.rb
roda-2.28.0 spec/plugin/unescape_path_spec.rb
roda-2.27.0 spec/plugin/unescape_path_spec.rb
roda-2.26.0 spec/plugin/unescape_path_spec.rb
roda-2.25.0 spec/plugin/unescape_path_spec.rb
roda-2.24.0 spec/plugin/unescape_path_spec.rb
roda-2.23.0 spec/plugin/unescape_path_spec.rb
roda-2.22.0 spec/plugin/unescape_path_spec.rb
roda-2.21.0 spec/plugin/unescape_path_spec.rb