-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathListing_11.29.rb
34 lines (29 loc) · 925 Bytes
/
Listing_11.29.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
require_relative 'test_helper'
class PalindromeAppTest < Minitest::Test
include Rack::Test::Methods
def app
Sinatra::Application
end
def test_index
get '/'
assert last_response.ok?
assert doc(last_response).at_css('h1')
title_content = doc(last_response).at_css('title').content
assert_equal "Learn Enough Ruby Sample App | Home", title_content
end
def test_about
get '/about'
assert last_response.ok?
assert doc(last_response).at_css('h1')
title_content = doc(last_response).at_css('title').content
assert_equal "Learn Enough Ruby Sample App | About", title_content
end
def test_palindrome
get '/palindrome'
assert last_response.ok?
assert doc(last_response).at_css('h1')
title_content = doc(last_response).at_css('title').content
assert_equal "Learn Enough Ruby Sample App | Palindrome Detector",
title_content
end
end