官方文档如下:

https://github.com/rspec/rspec-rails/blob/master/Capybara.md

Capybara 2.0

To use Capybara 2.0, you need rspec-rails-2.11.1 or greater.

Capybara::DSL is added to examples in:

  • spec/features

Capybara::RSpecMatchers is added to examples in:

  • spec/features
  • spec/controllers
  • spec/views
  • spec/helpers
  • spec/mailers

问题原因:Capybara2.0以后,集成测试的目录变了

解决方案为:默认生成的RSpec集成测试目录为requests目录,改为features目录即可解决问题

参考原文:https://github.com/rspec/rspec-rails/issues/360

undefined local variable or method ‘xxx’ for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xbc88d6c>错误解决方案的更多相关文章

  1. [异常]undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_1:0x16529f8 @example=nil>

    在进行Rspec 编译测试: bundle exec rspec spec/requests/static_pages_spec.rb 提示错误: FF Failures: 1) Static pag ...

  2. 错误:Attempt to resolve method: [XXX方法] on undefined variable or class name: [XXX类]的解决(IDEA打包jar问题)

    问题: 使用JMeter调用jar包的时候,报错误信息Typed variable declaration : Attempt to resolve method:[XXX方法] on undefin ...

  3. local variable 'xxx' referenced before assignment

    这个问题很囧,在外面定义了一个变量 xxx ,然后在python的一个函数或类里面引用这个变量,并改变它的值,结果报错local variable 'xxx' referenced before as ...

  4. 【转】The final local variable xxx cannot be assigned, since it is defined in an enclosing type

    文地址:http://blog.163.com/benben_long/blog/static/199458243201481102257544/ 本文就自己编程时候遇到的一个问题,简要描述一下,并提 ...

  5. python的UnboundLocalError: local variable 'xxx' referenced b

    一.意思: 本地变量xxx引用前没定义. 二.错误原因     在于python没有变量的声明 , 所以它通过一个简单的规则找出变量的范围 :如果有一个函数内部的变量赋值 ,该变量被认为是本地的,所以 ...

  6. Python问题:UnboundLocalError: local variable 'xxx' referenced before assignment

    参考链接: http://blog.csdn.net/onlyanyz/article/details/45009697 https://www.cnblogs.com/fendou-999/p/38 ...

  7. python: local variable 'xxx' referenced before assignment

    问题发现 xxx = 23 def PrintFileName(strFileName): if xxx == 23: print strFileName xxx = 24 PrintFileName ...

  8. local variable 'xxx' referenced before assignment(犯过同样的错)

    这个问题很囧,在外面定义了一个变量 xxx ,然后在Python的一个函数里面引用这个变量,并改变它的值,结果报错local variable 'xxx' referenced before assi ...

  9. dao 接口定义了一个方法,报错 The method xxx is undefined for the type xxx;

    转自:https://blog.csdn.net/panshoujia/article/details/78203837 持久层(DAO层)下的一个接口 ,eclipse报了一个The method ...

随机推荐

  1. 进程间通信之popen和pclose函数

    常见的操作是创建一个管道连接到另一个进程,然后读其输出或向其输入端发送数据,为此,标准I/O库提供了两个函数popen和pclose.这两个函数实现的操作是:创建一个管道,调用fork产生一个子进程, ...

  2. BFS-hdu-1226-超级密码

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1226 题目意思: 给一个N,给nn个jj进制的数字,问最小的不超过500位的由这些数字组成的jj进制 ...

  3. 小白日记7:kali渗透测试之主动信息收集-发现(一)--二层发现:arping/shell脚本,Netdiscover,scapy

    主动信息收集 被动信息收集可能不准确,可以用主动信息收集验证   特点:直接与目标系统交互通信,无法避免留下访问痕迹 解决方法:1.使用受控的第三方电脑进行探测,使用代理 (做好被封杀的准备)   2 ...

  4. A Simple Problem with Integers(线段树入门题)

    Description You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. On ...

  5. Android(java)学习笔记111:成员位置的内部类的介绍

    1.内部类的定义 /* 内部类概述: 把类定义在其他类的内部,这个类就被称为内部类. 举例:在类A中定义了一个类B,类B就是内部类. 内部的访问特点: A:内部类可以直接访问外部类的成员,包括私有. ...

  6. 线程NSThread的使用

    // // ZYThreadViewController.h // Thread // // Created by yejiong on 15/11/4. // Copyright © 2015年 z ...

  7. 完全自定义 TabBar

    // // CustomTabBarController.h // Dream // // Created by mac on 14-10-17. // Copyright (c) 2014年 HM. ...

  8. JavaScript开发之路02(Sencha Touch使用时常见问题及解决办法)

    1.Sencha中使用组件后通过layout: 'vbox'指定页面布局为垂直盒布局并且组件的高度采用height: '百分比'指定时,组件的背景色通过style: 'background:#F6F6 ...

  9. 简单遗传算法求解n皇后问题

    版权声明:本文为博主原创文章,转载请注明出处. 先解释下什么是8皇后问题:在8×8格的国际象棋上摆放八个皇后,使其不能互相攻击,即任意两个皇后都不能处于同一行.同一列或同一斜线上,问有多少种摆法.在不 ...

  10. Jersey(1.19.1) - Representations and Java Types

    Previous sections on @Produces and @Consumes referred to MIME media types of representations and sho ...