我有一个 Gemfile:
来源“https://rubygems.org”
宝石'导轨','3.2.11'
宝石'omniauth'
宝石'omniauth-facebook'
宝石“薄”
# 捆绑边缘 Rails:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
宝石'pg'
宝石“设计”
宝石'rmagick'
# 因为 rails_admin_jcrop 通过检查你使用的插件来自动加载模块,所以它是
# 建议在 rails_admin_jcrop 之前明确要求它
# 例如,如果你使用carrierwave
gem 'carrierwave', :require => 'carrierwave'
# 宝石仅用于资产,不是必需的
# 默认在生产环境中。
组:资产做
gem 'sass-rails', '~> 3.2.3'
宝石'咖啡轨','〜> 3.2.1'
宝石“指南针导轨”
宝石'zurb-基础'
# 有关更多支持的运行时,请参阅 https://github.com/sstephenson/execjs#readme
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
结尾
组:测试做
gem 'webrat', '>=0.7.2.pre', :git => 'http://github.com/kalv/webrat.git'
宝石“database_cleaner”
结尾
宝石'jquery-rails'
# 使用 ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# 为 JSON 使用 Jbuilder 模板
# 宝石'jbuilder'
# 使用独角兽作为应用服务器
# gem '独角兽'
# 使用 Capistrano 部署
# gem 'capistrano'
# 使用调试器
# gem '调试器'
宝石'therubyracer'
和 test_helper.rb:
ENV["RAILS_ENV"] = "测试"
需要 File.expand_path('../../config/environment', __FILE__)
需要'rails/test_help'
# 需要“webrat”
Webrat.configure 做 |config|
config.mode = :rails
结尾
类 ActiveSupport::TestCase
# 按字母顺序为所有测试设置 test/fixtures/*.(yml|csv) 中的所有夹具。
#
# 注意:您目前仍然需要在集成测试中明确声明固定装置
# -- 他们还没有继承这个设置
固定装置:所有
# 包括 Webrat
包括 Webrat::Methods
包括 Webrat::Matchers
# 在此处添加更多供所有测试使用的辅助方法...
结尾
类 ActionController::TestCase
包括设计::TestHelpers
结尾
我的测试是:
需要'test_helper'
类 UserSignupTest user.first_name
fill_in "user_last_name", :with => user.last_name
fill_in "user_username", :with => user.username
fill_in "user_email", :with => user.email
fill_in "user_password", :with => user.password
填写“user_password_confirmation”,:with => user.password_confirmation
选择(“user_sex_male”)
点击(“提交”)
结尾
结尾
但是当我尝试使用“点击”方法时出现以下错误:
1) 错误:
test_sign_up_flow(用户注册测试):
NoMethodError:未定义的方法“点击”#
你知道我做错了什么吗?我只是捆绑安装并认为它应该可以工作。“单击”方法之前的方法似乎以某种方式起作用。