Skip to content

Commit

Permalink
(test) env
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Kräuter authored and cloudhead committed Dec 7, 2010
1 parent 5aacd18 commit c8622d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/templates/index.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
<div id="archives">
<%= archives[3...5] %>
</div>

<!-- testing env variable passing -->
<p>env passed: <%= env != nil %><br/></p>
<!-- testing get/post parameter passing -->
<p>request method type: <%= env['REQUEST_METHOD'] %><br/></p>
<p>request name value pair: <%= env['QUERY_STRING'] %><br/></p>
10 changes: 10 additions & 0 deletions test/toto_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c8622d5

Please sign in to comment.