这是我的身份验证文件:
module Command
class AuthenticateUser
prepend SimpleCommand
...
end
end
然后我对此进行了测试:
require 'rails_helper'
RSpec.describe Command::AuthenticateUser do
...
end
运行测试时,出现此错误:
# --- Caused by: ---
# NameError:
# uninitialized constant Command
# ./spec/commands/authenticate_user_spec.rb:3:in `<top (required)>'
不确定我的代码在哪里,您能提出一些建议吗?
答案 0 :(得分:0)
尝试一下:
class AuthenticateUser
prepend SimpleCommand
...
end
&
require 'rails_helper'
describe AuthenticateUser do
...
end