Sha256: 6800b85fa470f8c38ca1bef3cf48895b6b8d2cbb9f986f6bbcb28bf6816dfa22

Contents?: true

Size: 986 Bytes

Versions: 1

Compression:

Stored size: 986 Bytes

Contents

require 'test/unit'
require 'i18n'
require 'i18n/backend/active_record'

require 'armot'
require 'logger'

ActiveRecord::Base.logger = Logger.new(nil)
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")

# Allow fallbacks to test production-like behaviour
I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Fallbacks)
I18n.backend = I18n::Backend::ActiveRecord.new

def setup_db
  ActiveRecord::Migration.verbose = false
  load "schema.rb"
end

def teardown_db
  ActiveRecord::Base.connection.tables.each do |table|
    ActiveRecord::Base.connection.drop_table(table)
  end
end

class Comment < ActiveRecord::Base
  armotize :msg
end

class Post < ActiveRecord::Base
  armotize :title, :text
  validates_presence_of :title
end

class Product < ActiveRecord::Base
  armotize :name

  def name=(value)
    super(value + " customized")
  end
end

# Puret translation model to test migration process
class PostTranslation < ActiveRecord::Base
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
armot-0.2.5 test/test_helper.rb