[ruby on rails]devise结合rspec的使用

  • 新增 spec/support/devise.rb:
touch spec/support/devise.rb

内容:

RSpec.configure do |config|
  config.include Devise::Test::ControllerHelpers, type: :controller
  config.include Devise::Test::ControllerHelpers, type: :view
  config.include Devise::Test::IntegrationHelpers, type: :feature
end
  • 使用
    Now you are ready to use the sign_inand sign_outmethods on your controller tests

你可能感兴趣的:(ruby,on,rails)