Use .with_locale for about page

This simplifies the code, since we can avoid having to specify the
locale for every translation.

The test was added since I originally developed another approach,
but that caused exceptions on invalid locales.
This commit is contained in:
Andy Allan 2023-03-15 18:08:59 +00:00
parent 5d86e624b0
commit a91afa0e78
3 changed files with 48 additions and 42 deletions

View file

@ -476,6 +476,11 @@ class SiteControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_template "about"
assert_select "div[lang='ar'][dir='rtl']"
# Page should still render even with incorrect locale
get about_path(:about_locale => "zzz")
assert_response :success
assert_template "about"
end
# Test the export page