2009-07-05 16:00:34 +00:00
|
|
|
require 'sinatra_app'
|
|
|
|
require 'test/unit'
|
|
|
|
require 'rack/test'
|
2009-06-01 17:53:37 +00:00
|
|
|
|
2009-07-05 16:00:34 +00:00
|
|
|
set :environment, :test
|
2009-06-01 17:53:37 +00:00
|
|
|
|
2009-07-05 16:00:34 +00:00
|
|
|
class SintraStaticAssetsTest < Test::Unit::TestCase
|
|
|
|
include Rack::Test::Methods
|
2009-06-01 17:53:37 +00:00
|
|
|
|
2009-07-05 16:00:34 +00:00
|
|
|
def app
|
|
|
|
Sinatra::Application
|
2009-06-01 17:53:37 +00:00
|
|
|
end
|
|
|
|
|
2009-07-05 16:00:34 +00:00
|
|
|
def test_it_says_hello_world
|
2009-06-01 17:53:37 +00:00
|
|
|
get '/'
|
|
|
|
assert last_response.ok?
|
2009-07-05 16:00:34 +00:00
|
|
|
assert_equal 'Hello World', last_response.body
|
2009-06-01 17:53:37 +00:00
|
|
|
end
|
2009-07-05 16:00:34 +00:00
|
|
|
|
|
|
|
def test_it_says_hello_to_a_person
|
|
|
|
get '/', :name => 'Simon'
|
|
|
|
assert last_response.body.include?('Simon')
|
2009-06-01 17:53:37 +00:00
|
|
|
end
|
|
|
|
end
|