null+****@clear*****
null+****@clear*****
2010年 6月 22日 (火) 16:23:34 JST
Kouhei Sutou 2010-06-22 07:23:34 +0000 (Tue, 22 Jun 2010)
New Revision: f931fd1eea5e84f09d6ca6ec73b70297fd4f6754
Log:
add a test for delete HTTP command.
Modified files:
test/unit/http/test-http-crud.rb
Modified: test/unit/http/test-http-crud.rb (+41 -0)
===================================================================
--- test/unit/http/test-http-crud.rb 2010-06-22 06:30:46 +0000 (88d1c12)
+++ test/unit/http/test-http-crud.rb 2010-06-22 07:23:34 +0000 (a77f0d8)
@@ -166,6 +166,47 @@ module HTTPCRUDTest
end
end
+ class HTTPDeleteTest < Test::Unit::TestCase
+ include GroongaHTTPTestUtils
+
+ def setup
+ setup_server
+ end
+
+ def teardown
+ teardown_server
+ end
+
+ def test_normal
+ populate_users
+
+ response = get(command_path(:select,
+ :table => "users",
+ :output_columns => "_key real_name"))
+ assert_response_body([[[2],
+ [["_key", "ShortText"], ["real_name", "ShortText"]],
+ ["hayamiz", "Yuto Hayamizu"],
+ ["ryoqun", "Ryo Onodera"]]],
+ response,
+ :content_type => "application/json")
+
+ response = get(command_path(:delete,
+ :table => "users",
+ :key => "hayamiz"))
+ assert_success_response(response,
+ :content_type => "application/json")
+
+ response = get(command_path(:select,
+ :table => "users",
+ :output_columns => "_key real_name"))
+ assert_response_body([[[2],
+ [["_key", "ShortText"], ["real_name", "ShortText"]],
+ ["ryoqun", "Ryo Onodera"]]],
+ response,
+ :content_type => "application/json")
+ end
+ end
+
class HTTPSetTest < Test::Unit::TestCase
include GroongaHTTPTestUtils