Попытка перейти к буквальному пути не работает.
require 'test_helper'
class Info::AccountPendingControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get '/account-pending', locale: 'en'
assert_response :success
assert_equal "index", @controller.action_name
assert_equal "account_pending", @controller.controller_name
end
end
Результат
ERROR["test_should_get_index", Minitest::Result, 0.21732900000642985]
test_should_get_index#Minitest::Result (0.22s)
ArgumentError: ArgumentError: unknown keyword: locale
test/controllers/info/account_pending_controller_test.rb:6:in `block in <class:AccountPendingControllerTest>'
Итак, как мы можем перейти в локали для незарегистрированного пользователя, вуровень теста?