sample_rails_tailwind/test/controllers/static_pages_controller_test.rb
songtianlun a91fc8f729 feat: add header and footer layout components
- Implement header and footer partials for better layout
- Create a full_title helper method for dynamic page titles
- Update application layout to use new header and footer
- Add typography styles for improved text presentation

These changes enhance the overall structure of the application by
introducing reusable header and footer components, which improves
maintainability. The full_title helper method allows for dynamic
titles across different pages, providing a consistent user
experience. Additionally, typography styles have been added to
improve readability and aesthetics.
2024-12-30 17:54:42 +08:00

40 lines
891 B
Ruby

require "test_helper"
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
def setup
@base_title = "Ruby on Rails Tutorial Sample App"
end
test "should get root" do
get root_url
assert_response :success
assert_select "title", "Home | #{@base_title}"
end
test "should get home" do
get static_pages_home_url
assert_response :success
assert_select "title", "Home | #{@base_title}"
end
test "should get help" do
get static_pages_help_url
assert_response :success
assert_select "title", "Help | #{@base_title}"
end
test "Should get about" do
get static_pages_about_url
assert_response :success
assert_select "title", "About | #{@base_title}"
end
test "Should get contact" do
get static_pages_contact_url
assert_response :success
assert_select "title", "Contact | #{@base_title}"
end
end