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
Search Repo:
jmettraux (author)
Wed Apr 30 22:28:53 -0700 2008
commit  53ef8e94ca9995bcef04dc69e15e2d3454fe901a
tree    c2e7927bef03c22db556839f406fc2a10fcf8749
parent  b49482e567581e899e976930e0915d88f837aa60
rufus-verbs / test / escape_test.rb
100644 39 lines (26 sloc) 0.717 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
38
39
#
# Testing rufus-verbs
#
# jmettraux@gmail.com
#
# Tue Feb 12 23:10:54 JST 2008
#
 
require 'test/unit'
 
require 'rufus/verbs'
 
 
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