在进行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

以上,解决~

最新文章

  1. centos 安装 opencv-3.1.0
  2. Atitit.加密算法ati Aes的框架设计v2.2
  3. 看门外汉如何实现:C#操作 MongoDB基本CURD的事务控制之 第二部分
  4. [IoC容器Unity] :Unity预览
  5. UVA 1160 X-Plosives
  6. weblogic jsp 不生效解决方法
  7. C++编程命名规范
  8. Quartz时间配置
  9. web版的tty
  10. 利用 xrandr 命令修改屏幕分辨率
  11. 初识SSO与JWT
  12. .NET反编译工具:de4dot
  13. Excel 数据验证宏
  14. 【webpack】中file-loader和url-loader使用方法
  15. JDK工具 javap
  16. python 实现wav的波形显示(时域和频域)
  17. [C++]油田(Oil Deposits)-用DFS求连通块
  18. C# 可指定并行度任务调度器
  19. 倒置输入的整数(C、Python)
  20. poj2970 The lazy programmer 【优先队列】

热门文章

  1. html5--5-9 绘制扇形
  2. Win8风格的WPF按钮
  3. php filter 安全过滤函数
  4. 002 - 配置Pycharm的背景颜色为豆沙绿护眼
  5. 初始化cache_dir(squid)
  6. [LeetCode] Scramble String -- 三维动态规划的范例
  7. TX2 刷机过程
  8. poj1151 Atlantis——扫描线+线段树
  9. HDU2222(AC自动机入门题)
  10. 注册页面Page的内置属性以及函数 路由 模块化