Sha256: 97a1f0b2893429dba2bc59788e051f006d8669b039c36b2c1884816d47012044
Contents?: true
Size: 752 Bytes
Versions: 14
Compression:
Stored size: 752 Bytes
Contents
# encoding: utf-8 require_relative 'test_helper' class CgiExtTest < Test::Unit::TestCase def test_url_for assert_equal "/abc", CGI.url_for("/abc") assert_equal "/abc?p=12", CGI.url_for("/abc", :p => 12) assert_equal "/abc?a=1&b=1&p=12", CGI.url_for("/abc?a=1&b=1", :p => 12) assert_equal "/abc?p=1&p=12", CGI.url_for("/abc?p=1", :p => 12) end def test_url_for_escaping assert_equal "/abc?p=foo+bar", CGI.url_for("/abc", :p => "foo bar") assert_equal "/abc?p=foo+%3E+bar", CGI.url_for("/abc", :p => "foo > bar") assert_equal "/abc?p=foo+%26+bar", CGI.url_for("/abc", :p => "foo & bar") assert_equal "/abc?p=foo+%C3%A4+bar", CGI.url_for("/abc", :p => "foo รค bar") end end
Version data entries
14 entries across 14 versions & 1 rubygems