mirror of
https://github.com/TracksApp/tracks.git
synced 2026-04-18 01:59:02 +02:00
Test the index page with all locales to make sure missing frontend locale files aren't fatal
This commit is contained in:
parent
0b167bade4
commit
e669a18733
3 changed files with 33 additions and 11 deletions
22
test/integration/locale_test.rb
Normal file
22
test/integration/locale_test.rb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
require 'test_helper'
|
||||
|
||||
class LocaleTest < ActionDispatch::IntegrationTest
|
||||
|
||||
fixtures :users
|
||||
|
||||
def test_locale_index
|
||||
logs_in_as(users(:other_user_email), 'open')
|
||||
@user = User.find(@request.session['user_id'])
|
||||
locales = I18n.available_locales.map {|l| l.to_s}
|
||||
locales.each do |locale|
|
||||
# Set the locale
|
||||
@user.preference.locale = locale
|
||||
@user.preference.save!
|
||||
logs_in_as(users(:other_user_email), 'open')
|
||||
get '/'
|
||||
assert_response :success
|
||||
assert_template "todos/index"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue