From c8622d556b9d262d0005b9cf12b5a10194827c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20Kr=C3=A4uter?= Date: Tue, 7 Dec 2010 15:46:01 -0500 Subject: [PATCH] (test) env --- test/templates/index.rhtml | 6 +++++- test/toto_test.rb | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/test/templates/index.rhtml b/test/templates/index.rhtml index ab38e5f..07184eb 100644 --- a/test/templates/index.rhtml +++ b/test/templates/index.rhtml @@ -6,4 +6,8 @@
<%= archives[3...5] %>
- + +

env passed: <%= env != nil %>

+ +

request method type: <%= env['REQUEST_METHOD'] %>

+

request name value pair: <%= env['QUERY_STRING'] %>

diff --git a/test/toto_test.rb b/test/toto_test.rb index 8b1ed62..aa090b6 100644 --- a/test/toto_test.rb +++ b/test/toto_test.rb @@ -101,6 +101,16 @@ asserts("body should be valid xml") { topic.body }.includes_html("feed > entry" => /.+/) asserts("summary shouldn't be empty") { topic.body }.includes_html("summary" => /.{10,}/) end + context "GET /index?param=testparam (get parameter)" do + setup { @toto.get('/index?param=testparam') } + asserts("returns a 200") { topic.status }.equals 200 + asserts("content type is set properly") { topic.content_type }.equals "text/html" + asserts("contain the env variable") { topic.body }.includes_html("p" => /env passed: true/) + asserts("access the http get parameter") { topic.body }.includes_html("p" => /request method type: GET/) + asserts("access the http parameter name value pair") { topic.body }.includes_html("p" => /request name value pair: param=testparam/) + end + + context "GET to a repo name" do setup do