public
Description: GET, POST, PUT, DELETE, with something around (ruby)
Homepage: http://rufus.rubyforge.org/rufus-verbs
Clone URL: git://github.com/jmettraux/rufus-verbs.git
jmettraux (author)
Mon Mar 23 17:33:50 -0700 2009
commit  3159e3a12c41e0aafbba7d4f1a3f7e1f604186cc
tree    8788b7a11698f6cc8f137d10e5dc13081fa66345
parent  2227f78519a2e862403baaa17c1592bdccfd0912
rufus-verbs / test / escape_test.rb
100644 37 lines (25 sloc) 0.644 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#
# Testing rufus-verbs
#
# jmettraux@gmail.com
#
# Tue Feb 12 23:10:54 JST 2008
#
 
require File.dirname(__FILE__) + '/base.rb'
 
 
class EscapeTest < Test::Unit::TestCase
 
  include Rufus::Verbs
 
 
  def test_0
 
    req = put(
      :dry_run => true,
      :uri => "http://localhost:7777/items/1",
      :query => { "a" => "hontou ni ?" })
 
    assert_equal "/items/1?a=hontou%20ni%20?", req.path
 
    req = put(
      :dry_run => true,
      :uri => "http://localhost:7777/items/1",
      :params => { "a" => "hontou ni ?" },
      :no_escape => true)
 
    assert_equal "/items/1?a=hontou ni ?", req.path
      # would fail anyway...
  end
end