这是奇怪的问题,宙斯开始顺利运行.
rspec spec /它的工作是否完美.
My spec_helper config is # encoding: UTF-8 require 'rubygems' # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment",__FILE__) require 'rspec/rails' require 'email_spec' require 'rspec/autorun' require 'capybara/rspec' require 'shoulda-matchers' require 'shoulda/matchers/integrations/rspec' Dir["./spec/support/**/*.rb"].sort.each {|f| require f} RSpec.configure do |config| config.include FactoryGirl::Syntax::Methods config.include Devise::TestHelpers,type: :controller config.include Capybara::DSL,type: :request config.treat_symbols_as_Metadata_keys_with_true_values = true config.mock_with :rspec config.use_transactional_fixtures = true end
我在spec / support / shared_contexts.rb(通常包含)中共享了上下文. rspec spec /通过所有测试,然后zeus rspec spec /传递所有测试,并抛出包含错误,像这样
`find_and_eval_shared’:找不到有签名用户的共享上下文(ArgumentError)
它尝试传递zeus rspec spec / models,然后抛出’factory_girl’包含错误,而rspec spec / models做的工作正常.
解决方法
我发现这个行为是由原因造成的
require 'rspec/autotest'
在spec_helper.rb