spec/spec_helper.rb in activeform-rails-0.0.2 vs spec/spec_helper.rb in activeform-rails-0.0.3
- old
+ new
@@ -2,13 +2,18 @@
require 'activeform-rails'
require 'database_cleaner'
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
- :database => "#{Dir.pwd}/database.sqlite3"
+ :database => ':memory:'
)
+['CREATE TABLE categories(id INTEGER PRIMARY KEY, title, user_id)',
+ 'CREATE TABLE users(id INTEGER PRIMARY KEY, name)'].each do |sql|
+ ActiveRecord::Base.connection.execute sql
+end
+
class User < ActiveRecord::Base
has_many :categories
end
class Category < ActiveRecord::Base
@@ -27,6 +32,9 @@
config.after(:each) do
DatabaseCleaner.clean
end
end
+
+# hide deprecation warnings, see http://stackoverflow.com/questions/20361428/rails-i18n-validation-deprecation-warning
+I18n.config.enforce_available_locales = true