[异常]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 pages Home page should have the content 'Sample App'
Failure/Error: visit '/static_pages/home'
NoMethodError:
undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xba8829c>
# ./spec/requests/static_pages_spec.rb:5:in `block (3 levels) in <top (required)>'
2) Static pages Help page should have the content 'Help'
Failure/Error: visit '/static_pages/help'
NoMethodError:
undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_2:0xba8cd4c>
# ./spec/requests/static_pages_spec.rb:11:in `block (3 levels) in <top (required)>'
Finished in 0.00409 seconds
2 examples, 2 failures
Failed examples:
rspec ./spec/requests/static_pages_spec.rb:4 # Static pages Home page should have the content 'Sample App'
rspec ./spec/requests/static_pages_spec.rb:10 # Static pages Help page should have the content 'Help'
Randomized with seed 29742
解决办法:
在static_pages_spec.rb的末尾加入
module ::RSpec::Core
class ExampleGroup
include Capybara::DSL
include Capybara::RSpecMatchers
end
end
以上,解决~
[异常]undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_1:0x16529f8 @example=nil>的更多相关文章
- undefined local variable or method ‘xxx’ for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xbc88d6c>错误解决方案
官方文档如下: https://github.com/rspec/rspec-rails/blob/master/Capybara.md Capybara 2.0 To use Capybara 2. ...
- [Ruby on Rails系列]4、专题:Rails应用的国际化[i18n]
1. 什么是internationalization(i18n)? 国际化,英文简称i18n,按照维基百科的定义:国际化是指在设计软件,将软件与特定语言及地区脱钩的过程.当软件被移植到不同的语言及地区 ...
- undefined method `environment' for nil:NilClass when importing Bootstrap into rails
今天做项目时往Gemfile里加了各gem, 然后bundle update了一下, 然后悲剧了,出现了undefined method `environment' for nil:NilClass ...
- "undefined method `root' for nil:NilClass" error when using "pod install" 解决办法
如果pod undate 的时候报错"undefined method `root' for nil:NilClass" error when using "pod in ...
- [caffe]linux下安装caffe(无cuda)以及python接口
昨天在mac上折腾了一天都没有安装成功,晚上在mac上装了一个ParallelDesktop虚拟机,然后装了linux,十分钟就安装好了,我也是醉了=.= 主要过程稍微记录一下: 1.安装BLAS s ...
- [Swift]基础
[Swift]基础 一, 常用变量 var str = "Hello, playground" //变量 let str1="Hello xmj112288" ...
- gitlab ActionView::Template::Error (undefined method `[]' for nil:NilClass): 500错误
Started GET "/mygroup/myproject/tree/master/MyDirectory" for 127.0.0.1 at 2014-10-22 22:42 ...
- [译]一个灵活的 Trello 敏捷工作流
[译]一个灵活的 Trello 敏捷工作流 翻译自 An Agile Trello Workflow That Keeps Tasks Flexible Getting things done 可不只 ...
- iOS10收集IDFA,植入第三方广告[终结]--ADMob
[PS: 前段时间,公司做ASO推广,需要在应用中收集IDFA值,跟广告平台做交互!于是有了这个需求--] 1.首先,考虑了一下情况(自己懒 -_-#),就直接在首页上写了一个Banner,循环加载广 ...
随机推荐
- JSTL取整、读取数组、字符串连接
以通过formatNumber去掉小数. <fmt:formatNumber type='number' value='${(tv.timeLong-tv.timeLong%60)/60 }' ...
- cnn汉字识别 tensorflow demo
# -*- coding: utf-8 -*- import tensorflow as tf import os import random import tensorflow.contrib.sl ...
- Object.prototype.constructor
Returns a reference to the Object function that created the instance's prototype. 注意这个属性的值是函数本省的引用,而 ...
- node之get与post
Get获取内容: var http=require('http'), util=require('util'),//util 提供常用函数集合 url=require('url'); http.cre ...
- 洛谷P4013数字梯形问题——网络流24题
题目:https://www.luogu.org/problemnew/show/P4013 最大费用最大流裸题: 注意:在第二种情况中,底层所有点连向汇点的边容量应该为inf,因为可以有多条路径结束 ...
- 【Linux学习】Linux文件系统2—linux常用目录结构、绝对路径、相对路径
Linux文件系统2-linux常用目录结构.绝对路径.相对路径 一. 常见目录结构总结 Linux目录结构就是"树形结构",常见的目录结构: /bin 系统需要的命令位于此目录 ...
- Nginx的安装配置和tomcat负载均衡
Nginx简介 什么是nginx? Nginx是一款高性能的http 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器.由俄罗斯的程序设计师Igor Sysoev所开发,官方测试ngi ...
- Axure RP 7.0 标准教程(2)--基本介绍
母版:用来放置一些相同元素的部件 两个页面都放入母版 一处更改 所有更改 添加图片:双击可以本地添加 ---------- 创建share.axure账号 https://share.axur ...
- CSS3 制作魔方 - 相关立体样式
最好的实践,就是给定一个实践的目标去实践. 目标:利用 CSS3 的一些特性,绘制一个魔方,要可以玩转的那种,即上下左右每一层都可以独立旋转.效果如下: 为了完成此效果,将使用到以下相关概念和样式:坐 ...
- 洛谷 - P2568 - GCD - 欧拉函数
https://www.luogu.org/problemnew/show/P2568 统计n以内gcd为质数的数的个数. 求 \(\sum\limits_p \sum\limits_{i=1}^{n ...