每当我save_and_open_page
从测试中调用时,我的测试设置工作得非常好,可以很好地提供用 css 正确格式化的页面。然后我设置了一些 javascript 测试并对我的设置进行了一些更改(抱歉,我无法详细说明它们 - 我没有足够好的文档记录)。进行更改后,当我调用save_and_open_page
.
这是我的规范/spec_helper.rb
require 'rubygems'
require 'spork'
Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rspec'
require 'factory_girl'
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.add_setting(:seed_tables)
config.seed_tables = %w(notifications drug_names drug_modes drug_prefs db_tables db_columns column_values)
config.use_transactional_fixtures = false
config.before(:suite) do
DatabaseCleaner.strategy = :truncation, {except: config.seed_tables}
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
config.infer_base_class_for_anonymous_controllers = false
config.include Features::SessionHelpers, type: :feature
config.order = "random"
end
Spork.each_run do
FactoryGirl.reload
end
end
我的测试环境中安装了以下 gem;
gem 'rspec-rails', '2.13.0'
gem 'guard-rspec', '2.4.1'
gem 'rb-fsevent', '0.9.3'
gem 'terminal-notifier-guard', '1.5.3'
gem 'guard-spork', '1.5.0'
gem 'spork', '0.9.2'
gem 'capybara', '2.1.0'
gem 'timecop', '0.5.9.2'
gem 'launchy', '2.2.0'
gem 'factory_girl_rails', '4.2.1'
gem 'shoulda', '3.3.2'
gem 'faker', '1.1.2'
gem 'database_cleaner', '0.9.1'
gem 'selenium-webdriver', '2.32.1'
关于我做了什么来阻止它正常工作的任何线索?