我正在尝试使用Devise设置gem rails-perftest:
require 'test_helper'
require 'rails/performance_test_help'
class TasksTest < ActionDispatch::PerformanceTest
include Devise::TestHelpers
def setup
# Application requires logged-in user
david = login(:david)
end
test "my_tasks" do
get '/'
end
end
我收到了这个错误:
Error:
TasksTest#test_my_tasks:
NoMethodError: undefined method `env' for nil:NilClass
Devise :: TestHelpers可能称为request.env。如何使用Devise进行工作?
谢谢!
大卫