相关疑难解决方法(0)

Capybara测试:js => true ...路由错误:没有路由匹配[GET]"/ assets"

当我向他们添加":js => true"时,我在许多测试中遇到了类似的错误.例如:

    An error occurred in an after hook
      ActionController::RoutingError: No route matches [GET] "/assets"
      occurred at /Users/appletart/.rvm/gems/ruby-1.9.3-p0@eventful2/gems/actionpack-3.2.5/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
Run Code Online (Sandbox Code Playgroud)

我以前没有在我的应用程序中测试启用JavaScript的东西,只是通过升级到Capybara 2并安装Database Cleaner来设置这样做.config.use_transactional_fixtures = false,我在我的spec_helper文件中添加了一些前/后钩子(钩子?),我直接从这里接受的答案中复制.

我在跑:

  • Rails 3.2.5
  • Rspec-rails 2.12.2.

任何人都可以告诉我如何攻击这个?非常感谢!

    4) Event pages 'CREATE' submitting a valid form provides a success notification and displays new event's page 
    Failure/Error: Unable to find matching line from backtrace
    ActionController::RoutingError:
    No route matches [GET] "/assets"
    # /Users/appletart/.rvm/gems/ruby-1.9.3-p0@eventful2/gems/actionpack-3.2.5/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
    # /Users/appletart/.rvm/gems/ruby-1.9.3-p0@eventful2/gems/actionpack-3.2.5/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
    # /Users/appletart/.rvm/gems/ruby-1.9.3-p0@eventful2/gems/railties-3.2.5/lib/rails/rack/logger.rb:26:in `call_app'
    # /Users/appletart/.rvm/gems/ruby-1.9.3-p0@eventful2/gems/railties-3.2.5/lib/rails/rack/logger.rb:16:in `call'
    # /Users/appletart/.rvm/gems/ruby-1.9.3-p0@eventful2/gems/actionpack-3.2.5/lib/action_dispatch/middleware/request_id.rb:22:in …
Run Code Online (Sandbox Code Playgroud)

capybara rspec-rails ruby-on-rails-3

41
推荐指数
2
解决办法
1万
查看次数

标签 统计

capybara ×1

rspec-rails ×1

ruby-on-rails-3 ×1