我经历了相当痛苦的升级到RSpec 3.1.我有几个功能规格,在RSpec 2.99中起作用:
@H_403_2@undefined method `feature' for main:Object
我注意到我必须在我的其他规范中使用RSpec.describe,因为它们不再附加到主对象.相应的功能要求是什么?
在我的功能我需要’rails_helper’
@H_403_2@require 'rails_helper' feature 'Facebook Authentiation' do ... end投机/ rails_helper.rb
@H_403_2@# This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' require 'spec_helper' require File.expand_path("../../config/environment",__FILE__) require 'rspec/rails' require 'rails/application' # Add additional requires below this line. Rails is not loaded until this point! ActiveRecord::Migration.maintain_test_schema! RSpec.configure do |config| # If you're not using ActiveRecord,or you'd prefer not to run each of your # examples within a transaction,remove the following line or assign false # instead of true. config.use_transactional_fixtures = false # RSpec Rails can automatically mix in different behavIoUrs to your tests # based on their file location config.infer_spec_type_from_file_location! end投机/ spec_helper.rb
#
的Gemfile
@H_403_2@# ... group :development,:test do gem 'rspec-rails','~> 3.1.0' end # ... group :test do # ... gem 'capybara','~> 2.4.3' end