From cf5db8aab5fb94a27f30ad6476ff3571730d96fe Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Mon, 8 Aug 2016 16:51:43 -0700 Subject: [PATCH] Silence Devise deprecation in test configuration Code pilfered from spotlight and the dozen other apps that have to do the same workaround. --- spec/spec_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 08af865..917399b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,7 +13,12 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } RSpec.configure do |config| - config.include Devise::TestHelpers, type: :controller + if defined? Devise::Test::ControllerHelpers + config.include Devise::Test::ControllerHelpers, type: :controller + else + config.include Devise::TestHelpers, type: :controller + end + config.use_transactional_fixtures = true config.infer_base_class_for_anonymous_controllers = false config.order = 'random'