- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个在 Rails 4/Ruby 2 上运行的应用程序。前端正在用 Ember 开发。
运行时 rake spec
,我收到以下异常。它似乎只发生在 Rspec 功能规范中(不在开发模式下)。此外,通常只有当我只运行一个功能规范时才会发生这种情况;如果我运行整个测试套件,我通常不会收到错误消息。
由于此对 Rails 的提交,发生错误:
https://github.com/rails/rails/commit/b33700f5580b4cd85379a1dc60fa341ac4d8deb2
但是,当然,我不知道这是真正的问题还是调用堆栈中更深层次的问题。我确实知道,如果我对 Rails 代码进行最小的更改以不引发该错误,那么一切似乎都可以正常工作并且我的测试通过。但是,某处似乎正在尝试加载 LocationsController,即使它已经加载。
非常感谢任何帮助,因为这个让我真的很难过。
1) Locations Creating locations
Failure/Error: Unable to find matching line from backtrace
RuntimeError:
Circular dependency detected while autoloading constant LocationsController
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/dependencies.rb:460:in `load_missing_constant'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/dependencies.rb:183:in `const_missing'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:226:in `const_get'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:226:in `block in constantize'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:224:in `each'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:224:in `inject'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/inflector/methods.rb:224:in `constantize'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/dependencies.rb:534:in `get'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/dependencies.rb:565:in `constantize'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/routing/route_set.rb:76:in `controller_reference'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/routing/route_set.rb:66:in `controller'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/routing/route_set.rb:44:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/journey/router.rb:71:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/journey/router.rb:59:in `each'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/journey/router.rb:59:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/routing/route_set.rb:655:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/request_store-1.0.5/lib/request_store/middleware.rb:9:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/warden-1.2.1/lib/warden/manager.rb:35:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/warden-1.2.1/lib/warden/manager.rb:34:in `catch'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/warden-1.2.1/lib/warden/manager.rb:34:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/flash.rb:241:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/cookies.rb:486:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activerecord/lib/active_record/query_cache.rb:36:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/callbacks.rb:373:in `_run__1828229838678430325__call__callbacks'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/callbacks.rb:80:in `run_callbacks'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/rack/logger.rb:38:in `call_app'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/rack/logger.rb:21:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/tagged_logging.rb:67:in `block in tagged'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/tagged_logging.rb:25:in `tagged'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/tagged_logging.rb:67:in `tagged'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/rack/logger.rb:21:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/quiet_assets-1.0.2/lib/quiet_assets.rb:18:in `call_with_quiet_assets'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/request_id.rb:21:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/activesupport/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/actionpack/lib/action_dispatch/middleware/static.rb:64:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/engine.rb:511:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/bundler/gems/rails-783c6711a4b4/railties/lib/rails/application.rb:97:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/capybara-2.1.0/lib/capybara/server.rb:19:in `call'
# /usr/local/rvm/gems/ruby-2.0.0-p195@nepco/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
# /usr/local/rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
# /usr/local/rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
# /usr/local/rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
get '/locations', to: 'main#index', :as => :em_locations
scope 'api' do
resources :locations, only: [:index]
end
* capybara (2.1.0)
* rspec (2.13.0)
* rspec-core (2.13.1)
* rspec-expectations (2.13.0)
* rspec-mocks (2.13.1)
* rspec-rails (2.13.2)
* ember-data-source (0.0.5)
* ember-rails (0.12.0)
* ember-source (1.0.0.rc3.3)
* active_model_serializers (0.8.1)
require 'spec_helper'
feature 'Locations', js: true, strategy: :truncation, slow: true do
before do
login_for_request
Factory.create(:warehouse, code: "TW", name: 'TEST WAREHOUSE')
end
scenario "Creating locations" do
visit em_locations_path
click_link "create-locations"
select 'TEST WAREHOUSE', from: "warehouse"
select "GLD", from: "section"
fill_in "row-start", with: "AA"
fill_in "row-end", with: "AB"
fill_in "bay-start", with: "1"
fill_in "bay-end", with: "2"
fill_in "tier-start", with: "1"
fill_in "tier-end", with: "2"
fill_in "subbay-start", with: "1"
fill_in "subbay-end", with: "2"
click_button "Create"
end
end
最佳答案
我想出了一个可能的解决方案来解决这个问题。这可能不是最好的方法,我认为没有必要,但它仍然有效并且始终如一。
在我的功能规范中,我需要相关的 Controller :
require_relative '../../app/controllers/locations_controller'
require_relative '../serializers/location_serializer'
关于ruby-on-rails - Rspec 请求规范期间 Rails 4 中的循环依赖错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16820158/
我们有一个 Java 项目,每天晚上使用 TeamCity 对 Java 类进行静态分析,以查找代码中容易出现的错误。我们想告诉 TeamCity 寻找开发人员可能引入的与 == 与 .equals
前言 🍊缘由 Git分支管理好,走到哪里都是宝 🏀事情起因: 最近翻看博客中小伙伴评论时,发现文章【规范】看看人家Git提交描述,那叫一个规矩一条回复: 本狗亲测在我司中使用规范
使用带有不存在的命名空间的命名空间限定关键字来定义规范是否被认为是不好的做法?我想在公共(public) domain 命名空间中定义实体映射...所以为了避免在合并规范时丢失数据,我使用约定 :en
有没有办法在调用 clojure.spec.test.alpha/check 时覆盖核心谓词函数的生成器? 可以通过 s/gen 中的路径覆盖谓词生成器: (gen/generate (s/gen
以内核 rpm 为例,它允许在一个系统上同时安装多个版本。规范文件中究竟是什么允许的? 我想打包一个已经存在的具有不同安装前缀的多个版本的项目。 最佳答案 百胜 找到了让 yum 安装而不是更新的方法
我正在尝试用 C# 编写 PDF 解析器,但我遇到了一个问题,我不确定如何解释规范。 除非另有说明,否则 PDF 文档中的用户空间为 1/72 英寸(即 1pt)。 Tf 运算符提供的比例将字体从标准
我正在编写一些代码,需要能够获取两个 pdf 并将它们附加到页面级别(例如,如果它们都是 2 页文档,则有一个 4 页文档,其中所有 4 页都与原始文档相同). 在不使用库的情况下,最好的方法是什么?
是否有序言语言语法,或接近它的通常用作引用的东西?我正在使用 SWI-prolog,所以有一个适合这种风格的会很好,否则一般的 prolog 语言语法/规范也能工作。 最佳答案 自 1995 年起,P
我需要一个函数来过滤参数和构建查询。我有 4 个参数,因此如果我尝试为每个条件实现查询,我将不得不写 16 (2^4)实现 - 这不是一个好主意。 我尝试使用界面改进我的代码 Specificatio
这个 ExtGState 对象对图像做了什么: > 我有 PDF 规范,但一点也不清楚。显然,这将身份函数(什么的身份?单位矩阵?)从 [0.0 1.0] 映射到 [0.0 1.0](相同),这是没有
只是想获得有关 ePub 规范的一些帮助。toc.ncx 是否必须具有 src(即 xhtml)。我观察到 .opf 文件中也提供了相同的内容 src。 最佳答案 是的,这是强制性的,这是一个设计问题
让我们看看莱宁根项目 map 的真实示例 :global-vars : ;; Sets the values of global vars within Clojure. This example
我正在开发一个 LOB 框架,它具有 SL 和 MVC 前端、WCF 后端以及在服务器上运行的几个服务模块。我一直在查看 Spec#,看它是否对我有任何帮助。不可空类型和检查异常本身非常好,但我还没有
Promises/A+规范是最小的规范之一。因此,实现它是理解它的最佳方法。福布斯·林德赛(Forbes Lindesay)的以下回答将引导我们完成实现Promises / A +规范Basic Ja
哪个文档指定了 MySQL definer 格式? 具体来说,definer admin@% 中的 % 是什么意思(以及为什么使用这个符号)? 最佳答案 这里MySQL使用的格式定义在the MySQ
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
在 css 规范中,什么会影响更多的 inline 样式或外部 !important 外部“style.css”: #di{color: green!important;} div 文本颜色是红色还
我正在努力思考 CSS 的一些细节,我从 W3 CSS Visual Formatting Spec 9.2.2 中找到了这部分摘录。特别迟钝: Inline-level boxes that are
这个问题在这里已经有了答案: Are (non-void) self-closing tags valid in HTML5? (8 个答案) 关闭 9 年前。 在 HTML5 中你应该使用 或
以下样式在规范方面有何不同? ul .active { background: #E7F3EF;} ul li.active { background: #E7F3EF;} Item 1
我是一名优秀的程序员,十分优秀!