Skip to content

Instantly share code, notes, and snippets.

@guilleiguaran
Last active August 29, 2015 14:12
Show Gist options
  • Save guilleiguaran/56a3879da5f6b6f467ce to your computer and use it in GitHub Desktop.
Save guilleiguaran/56a3879da5f6b6f467ce to your computer and use it in GitHub Desktop.
MiniTest::Spec + ActiveRecord 4.2
require 'active_record'
require 'active_record/fixtures'
class MiniTest::Spec
ActiveRecord::Base.establish_connection
ActiveRecord::Migration.check_pending!
include ActiveRecord::TestFixtures
alias :method_name :name if defined? :name
self.use_instantiated_fixtures = false
self.use_transactional_fixtures = true
self.fixture_path = File.join(File.dirname(__FILE__), 'fixtures')
fixtures :all
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment