RSpec: Include a custom helper module in spec_helper.rb

泄露秘密 提交于 2019-12-06 08:18:16

The module you defined does not match that which you are trying to include.

You have the module named FeautreHelper, but are trying to include FeatureHelper. Notice that there is a typo in the module name - the u is in the wrong spot.

The module should be renamed:

module FeatureHelper
  def login
    shop = create(:shop)
    user = create(:user)
    login_as user, scope: :user
    user
  end
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!