Skip to content

Commit

Permalink
fix mongoid test on rails 5
Browse files Browse the repository at this point in the history
  • Loading branch information
scambra committed Aug 5, 2016
1 parent 5f0f411 commit b0e7292
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/test_helper.rb
Expand Up @@ -25,13 +25,15 @@ class ActionController::TestCase
else
include Devise::TestHelpers
end
if Rails.version >= '5.0.0'
self.use_transactional_tests = true
elsif defined? ActiveRecord
begin
require 'test_after_commit'
self.use_transactional_fixtures = true
rescue LoadError
if defined? ActiveRecord
if Rails.version >= '5.0.0'
self.use_transactional_tests = true
else
begin
require 'test_after_commit'
self.use_transactional_fixtures = true
rescue LoadError
end
end
end
end

0 comments on commit b0e7292

Please sign in to comment.