NoMethodError: undefined method `visit' for RSpec(解决)
来源:互联网 发布:金蛇狂舞 网络歌手 编辑:程序博客网 时间:2024/06/06 04:11
在rails4中使用capybara+rspec进行测试的时候显示NoMethodError: undefined method `visit' for RSpe,如下图所示
这是由于没有引入capybara的DSL,需要在rails_spec.rb文件中添加相应的代码,
config.include Capybara::DSL
config.expect_with(:rspec) { |c| c.syntax = :should }
再次进行测试,就不会出现这个问题了
0 0
- NoMethodError: undefined method `visit' for RSpec(解决)
- NoMethodError:undefined method to_ISO8601 for nil:NilClass
- NoMethodError (undefined method `paginate'
- (Rails) : NoMethodError: undefined method cost' for BCrypt::Engine:Class
- cloud foundry vmc push应用时NoMethodError: undefined method `buildpack' for #<CFoundry::V1::App 'hello'
- Git Push问题remote: hooks/update:10 undefined method 'require_relative' for main:Object(NomethodError)
- `add_frozen_gem_path': undefined method `source_index' for Gem:Module (NoMethodError) OR Gem.source_
- ruby1.8.7/rails2.3.11--启动报错"undefined method `source_index' for Gem:Module (NoMethodError)"
- gem安装时出现 undefined method `size' for nil:NilClass (NoMethodError) 的解决办法
- rspec spec/ 测试不通过,报 undefined method `assertions' 错
- 解决The method getCookieStore() is undefined for the type HttpClient
- 解决The method getDispatcherType() is undefined for the type HttpServletRequest
- Visit Method
- rails undefined method `each’ for
- undefined method 'before_filter' for Class
- MACRO of a method of loop list for visit elements
- Ruby on rails /rspec undefine 'visit'
- The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory 错误的解决
- 30岁到35岁:为你的生命多积累一些厚度
- PHP魔术常量:__LINE__ __FILE__ __CLASS__ ```
- String,StringBuffer与StringBulider三者的区别
- just for test
- 1008. 数组元素循环右移问题 (20)
- NoMethodError: undefined method `visit' for RSpec(解决)
- IOS学习路线
- 《PHP从零开始》学习笔记
- Linux环境下Python的安装过程
- 基因数据处理29之avocado运行snap-basic有问题
- iOS中UIApplication的用法
- poj--1306 Combinations(组合数)
- 修改linpack源程序时遇到的各种问题.
- 通过 manifest 获取管理员权限