无法运行单个(!)rails interactor at rails 6.根据https://github.com/collectiveidea/interactor-rails执行: rails生成交互器authenticate_user来创建交互器。命令bin/rspec运行良好,并生成输出:
Pending: (Failures listed here are expected and do not affect your suite's status)
1) AuthenticateUser.call add some examples to (or delete) /Users/.../spec/interactors/authenticate_user_spec.rb
# Not yet implemented
# ./spec/interactors/authenticate_user_spec.rb:5命令bin/rspec spec/interactors/authenticate_user_spec.rb运行单个interactor会产生错误:
An error occurred while loading ./spec/interactors/authenticate_user_spec.rb.
Failure/Error:
RSpec.describe AuthenticateUser, type: :interactor do
describe '.call' do
pending "add some examples to (or delete) #{__FILE__}"
end
end
NameError:
uninitialized constant AuthenticateUser
# ./spec/interactors/authenticate_user_spec.rb:3:in `<top (required)>'
No examples found.
Finished in 0.00004 seconds (files took 0.25648 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples有没有人知道如何运行单个交互器的规范?据我所知,interactors dir不是自动加载的。谢谢!
你诚心的,安娜
发布于 2020-07-13 19:13:05
fix:默认生成器生成"require 'spec_helper'",应替换为"require 'rails_helper'“。此更换解决了此问题。
https://stackoverflow.com/questions/62833926
复制相似问题