【发布时间】:2019-02-12 10:44:53
【问题描述】:
尝试传递给文字路径名不起作用。
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>'
那么我们如何在测试级别为未登录用户传递语言环境?
【问题讨论】:
标签: ruby-on-rails integration-testing minitest