首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法运行单个(!)rails在rails 6中的交互器

无法运行单个(!)rails在rails 6中的交互器
EN

Stack Overflow用户
提问于 2020-07-10 20:03:55
回答 1查看 160关注 0票数 2

无法运行单个(!)rails interactor at rails 6.根据https://github.com/collectiveidea/interactor-rails执行: rails生成交互器authenticate_user来创建交互器。命令bin/rspec运行良好,并生成输出:

代码语言:javascript
复制
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会产生错误:

代码语言:javascript
复制
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不是自动加载的。谢谢!

你诚心的,安娜

EN

回答 1

Stack Overflow用户

发布于 2020-07-13 19:13:05

fix:默认生成器生成"require 'spec_helper'",应替换为"require 'rails_helper'“。此更换解决了此问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62833926

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档