2024-12-29 17:22:48 +08:00
|
|
|
require "test_helper"
|
|
|
|
|
|
|
|
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
|
2024-12-30 00:09:54 +08:00
|
|
|
def setup
|
|
|
|
@base_title = "Ruby on Rails Tutorial Sample App"
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should get root" do
|
2024-12-31 00:37:02 +08:00
|
|
|
get root_path
|
2024-12-29 17:22:48 +08:00
|
|
|
assert_response :success
|
2024-12-31 14:20:22 +08:00
|
|
|
assert_select "title", full_title("Home")
|
2024-12-29 17:22:48 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "should get help" do
|
2024-12-31 00:37:02 +08:00
|
|
|
get help_path
|
2024-12-29 17:22:48 +08:00
|
|
|
assert_response :success
|
2024-12-31 14:20:22 +08:00
|
|
|
assert_select "title", full_title("Help")
|
2024-12-29 17:22:48 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "Should get about" do
|
2024-12-31 00:37:02 +08:00
|
|
|
get about_path
|
2024-12-29 17:22:48 +08:00
|
|
|
assert_response :success
|
2024-12-31 14:20:22 +08:00
|
|
|
assert_select "title", full_title("About")
|
2024-12-30 00:09:54 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
test "Should get contact" do
|
2024-12-31 00:37:02 +08:00
|
|
|
get contact_path
|
2024-12-30 00:09:54 +08:00
|
|
|
assert_response :success
|
2024-12-31 14:20:22 +08:00
|
|
|
assert_select "title", full_title("Contact")
|
2024-12-29 17:22:48 +08:00
|
|
|
end
|
|
|
|
end
|