test/simple_test.rb in rufus-verbs-0.9 vs test/simple_test.rb in rufus-verbs-0.10

- old
+ new

@@ -5,10 +5,12 @@ # jmettraux@gmail.com # # Sun Jan 13 12:33:03 JST 2008 # +require 'rubygems' + require 'test/unit' require 'testbase' require 'rufus/verbs' @@ -43,9 +45,26 @@ res = put :uri => "http://localhost:7777/items/0", :d => "Toto3", :fake_put => true assert_equal 200, res.code.to_i expect 200, { 0 => "Toto3" }, get(:uri => "http://localhost:7777/items") + end + + def test_0b + + expect 200, {}, get(:uri => "http://localhost:7777/items") + + res = post :uri => "http://localhost:7777/items", :d => "Toto" + assert_equal 201, res.code.to_i + assert_equal "http://localhost:7777/items/0", res['Location'] + + expect 200, "\"Toto\"", get(:uri => "http://localhost:7777/items/0") + + res = post :uri => "http://localhost:7777/items", :d => "Smurf" + assert_equal 201, res.code.to_i + assert_equal "http://localhost:7777/items/1", res['Location'] + + expect 200, "\"Smurf\"", get(:uri => "http://localhost:7777/items/1") end def test_1 ep = EndPoint.new(:host => "localhost", :port => 7777)