【问题标题】:rails-controller-testing Gemrails-controller-testing Gem
【发布时间】:2015-06-02 20:22:56
【问题描述】:

我刚刚将我的应用程序拉到了边缘轨道。我已经修复了大多数兼容性问题,但是测试现在给出了如下错误:

NoMethodError: assigns has been extracted to a gem. To continue using it,
    add `gem 'rails-controller-testing'` to your Gemfile.

第一次发生这种情况时,我将gem 'rails-controller-testing' 添加到Gemfile:test 组中并运行bundle。根据这个过程,gem 现在安装在版本0.0.3,但是我得到了同样的错误。我该如何解决?

【问题讨论】:

  • 你能附上你的gemfile吗?

标签: ruby-on-rails testing gem


【解决方案1】:

尝试在 spec_helper.rb 中添加它

RSpec.configure do |config|
  [:controller, :view, :request].each do |type|
    config.include ::Rails::Controller::Testing::TestProcess, :type => type
    config.include ::Rails::Controller::Testing::TemplateAssertions, :type => type
    config.include ::Rails::Controller::Testing::Integration, :type => type
  end
end

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-29
    • 2015-02-04
    • 2014-05-26
    • 1970-01-01
    相关资源
    最近更新 更多