ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Search Repo:
ryah (author)
Sun Apr 06 09:02:25 -0700 2008
commit  3afab8fa81d2321e45f05addbb75a55d99a9a783
tree    168434fd9899d2ffb2e9eb38b6852c818b741375
parent  c44f2b57ebd5098a3cda708ac2dde2bdb44b46c6
ebb / test / basic_test.rb
100644 29 lines (25 sloc) 0.678 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
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['output']
    end
  end
  
  def test_get_unknown
    response = get('/blah')
    assert_equal "Undefined url", response['output']
  end
  
  def test_small_posts
    [1,10,321,123,1000].each do |i|
      response = post("/test_post_length", 'C'*i)
      assert_equal 200, response['status']
    end
  end
  
  def test_large_post
    [50,60,100].each do |i|
      response = post("/test_post_length", 'C'*1024*i)
      assert_equal 200, response['status']
    end
  end
end