Created
April 5, 2013 15:43
-
-
Save dmgarland/5320318 to your computer and use it in GitHub Desktop.
Movie Server Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test/unit' | |
require 'rack/test' | |
require_relative '../movie_server' | |
class MovieServerTest < Test::Unit::TestCase | |
include Rack::Test::Methods | |
def app | |
Sinatra::Application | |
end | |
def test_welcome_page | |
get '/' | |
assert last_response.ok? | |
end | |
def test_missing_name_redirects_home | |
post '/film', { :name => ""} | |
follow_redirect! | |
assert_equal last_request.path, '/' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment