-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathListing_11.42.rb
37 lines (31 loc) · 934 Bytes
/
Listing_11.42.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
35
36
37
require_relative 'test_helper'
class PalindromeAppTest < Minitest::Test
include Rack::Test::Methods
def app
Sinatra::Application
end
def setup
@base_title = "Learn Enough Ruby Sample App"
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 "#{@base_title} | 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 "#{@base_title} | 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 "#{@base_title} | Palindrome Detector", title_content
end
end