Skip to content

Instantly share code, notes, and snippets.

@dmgarland
Created April 5, 2013 15:43
Show Gist options
  • Save dmgarland/5320318 to your computer and use it in GitHub Desktop.
Save dmgarland/5320318 to your computer and use it in GitHub Desktop.
Movie Server Test
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