forked from mleone/broadcast
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.rb
51 lines (41 loc) · 950 Bytes
/
test.rb
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
require File.join(File.dirname(__FILE__), 'environment')
require 'test/unit'
require 'rack/test'
ENV['RACK_ENV'] = 'test'
class HelloWorldTest < Test::Unit::TestCase
include Rack::Test::Methods
def app
Broadcast
end
def test_it_shows_index_page
get '/'
assert last_response.ok?
end
def test_get_snapshot
get '/snapshot.jpg'
assert last_response.ok?
assert last_response.body.length > 10000
end
def test_get_update
get '/update.jpg'
assert last_response.ok?
assert last_response.body.length > 10000
end
def test_get_location
get '/location.json'
assert last_response.ok?
end
def test_download
get '/download?file=/snapshots/latest.jpg'
assert last_response.ok?
end
def test_upload
file = "automated_test_file.txt"
put "/upload?qqfile=#{file}"
assert last_response.ok?
end
def test_tts
post '/say.json'
assert last_response.ok?
end
end