我有以下使用 vanilla spec_helper 的示例代码。我正在尝试使用 sign_in_as,但收到一条错误消息,指出它不存在。我之前并没有真正看过这个配置语法,所以我不确定它是否被正确使用。任何帮助,将不胜感激?谢谢
在 helpers/sign_in_helpers.rb
module SignInHelpers
def say_hello
puts 'hello'
end
def sign_in
sign_in_as 'person@example.com'
end
def sign_in_as email
visit root_path
fill_in 'Email address', with: email
click_button 'Sign In'
end
end
RSpec.configure do |config|
config.include SignInHelpers
end