spec/spec_helper.rb in spree_gateway-2.2.1 vs spec/spec_helper.rb in spree_gateway-3.0.0
- old
+ new
@@ -4,28 +4,31 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require 'rspec/rails'
+require 'rspec/active_model/mocks'
require 'capybara/rspec'
require 'capybara/rails'
require 'capybara/poltergeist'
require 'database_cleaner'
require 'ffaker'
+require 'rspec/active_model/mocks'
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
require 'spree/testing_support/factories'
require 'spree/testing_support/order_walkthrough'
require 'spree/testing_support/preferences'
FactoryGirl.find_definitions
RSpec.configure do |config|
+ config.infer_spec_type_from_file_location!
config.mock_with :rspec
+ config.raise_errors_for_deprecations!
config.use_transactional_fixtures = false
-
#config.filter_run focus: true
#config.filter_run_excluding slow: true
config.include FactoryGirl::Syntax::Methods
config.include Spree::TestingSupport::Preferences
@@ -34,10 +37,10 @@
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with :truncation
end
config.before do
- DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction
+ DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
DatabaseCleaner.start
reset_spree_preferences
end
config.after do