Sha256: 45071732b675a8d265d073d33e0e27fe6c9f8a75b3376ce4cc65024d579b2878

Contents?: true

Size: 738 Bytes

Versions: 12

Compression:

Stored size: 738 Bytes

Contents

# encoding: utf-8

require '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

12 entries across 12 versions & 2 rubygems

Version Path
radiospieler-0.3.0 test/cgi_ext_test.rb
radiospiel-app-0.2.10 test/cgi_ext_test.rb
radiospiel-app-0.2.9 test/cgi_ext_test.rb
radiospiel-app-0.2.7 test/cgi_ext_test.rb
radiospiel-app-0.2.6 test/cgi_ext_test.rb
radiospiel-app-0.2.5 test/cgi_ext_test.rb
radiospiel-app-0.2.3 test/cgi_ext_test.rb
radiospiel-app-0.2.2 test/cgi_ext_test.rb
radiospiel-app-0.2.1 test/cgi_ext_test.rb
radiospiel-app-0.2.0 test/cgi_ext_test.rb
radiospiel-app-0.1.1 test/cgi_ext_test.rb
radiospiel-app-0.1.0 test/cgi_ext_test.rb