Created
July 27, 2015 14:42
-
-
Save roelbondoc/6367334900ebd5cf37b3 to your computer and use it in GitHub Desktop.
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_helper' | |
class UrlShortenerTest < ActionDispatch::IntegrationTest | |
test 'it shortens URLs' do | |
original = 'http://en.wikipedia.org/wiki/Sports_game' | |
post '/', url: original | |
assert_response 201 | |
shortened = response.headers['Location'] | |
assert shortened.length < original.length, 'URL is actually shorter' | |
get '/', shortened: shortened | |
assert_redirected_to original | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment