sample_rails_tailwind/test/controllers/static_pages_controller_test.rb

34 lines
691 B
Ruby
Raw Normal View History

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
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
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
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
assert_select "title", full_title("Contact")
2024-12-29 17:22:48 +08:00
end
end