使用gem rails设置Devise-perftest @Rails 4.2.4

时间:2015-11-15 12:00:28

标签: ruby-on-rails devise

我正在尝试使用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进行工作?

谢谢!

大卫

0 个答案:

没有答案