ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Ryan Dahl (author)
Fri Mar 14 18:16:03 -0700 2008
commit  0a07adc53a3efabc3e20239a29163d86dd3c47b7
tree    cdfe1f3a96d5f7c361947818b8e8ad3f38edbf81
parent  b128ee31d3751baae5229187a8f6ad865dba63d1
ebb / test / basic_test.rb
100644 30 lines (25 sloc) 0.699 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
require File.dirname(__FILE__) + '/helper'
 
class BasicTest < ServerTest
  def test_get_bytes
    [1,10,1000].each do |i|
      response = get("/bytes/#{i}")
      assert_equal "#{'C'*i.to_i}", response.body
    end
  end
  
  def test_get_unknown
    response = get('/blah')
    assert_equal "Undefined url", response.body
  end
  
  def test_small_posts
    [1,10,321,123,1000].each do |i|
      response = post("/test_post_length", 'C'*i)
      assert_equal 200, response.code.to_i, response.body
    end
  end
  
  def test_large_post
    [50,60,100].each do |i|
      response = post("/test_post_length", 'C'*1024*i)
      assert_equal 200, response.code.to_i, response.body
    end
  end
end