Sha256: 2d38b4128f2cbf20149e47f762c0360471d90cba8ba297bba54f57e114faeb36
Contents?: true
Size: 912 Bytes
Versions: 1
Compression:
Stored size: 912 Bytes
Contents
require 'user_preferences' require 'active_record' require 'active_record/connection_adapters/sqlite3_adapter' RSpec.configure do |config| $stdout = StringIO.new # silence migrations ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') if ActiveRecord::VERSION::MAJOR >= 5 ActiveRecord::Migrator.migrations_paths = File.expand_path('../migrations', __FILE__) ActiveRecord::Base.connection.migration_context.migrate else ActiveRecord::Migrator.migrate(File.expand_path('../migrations', __FILE__)) end $stdout = STDOUT # prevent deprecation warnings I18n.enforce_available_locales = true config.before(:each) { stub_yml } end def stub_yml fixture = File.expand_path("../fixtures/user_preferences.yml", __FILE__) UserPreferences.stub(:yml_path).and_return(fixture) end class User < ActiveRecord::Base include UserPreferences::HasPreferences end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
user_preferences-1.0.1 | spec/spec_helper.rb |