class Object
Public Instance Methods
include_acts_as_translatable(model)
click to toggle source
# File test/test_helper.rb, line 68 def include_acts_as_translatable(model) model.class_eval "include Babbel::Concerns::ActsAsTranslatable" end
include_translatable(model)
click to toggle source
# File test/test_helper.rb, line 72 def include_translatable(model) model.class_eval "include Babbel::Concerns::Translatable" end
setup_bing_translator_env()
click to toggle source
# File test/test_helper.rb, line 63 def setup_bing_translator_env ENV['BING_TRANSLATOR_APP_ID'] = 'set' ENV['BING_TRANSLATOR_SECRET'] = 'set' end
setup_destination()
click to toggle source
# File test/test_helper.rb, line 30 def setup_destination destination File.expand_path '../../../tmp', __FILE__ setup :prepare_destination end
setup_model(model = :test_model)
click to toggle source
# File test/test_helper.rb, line 35 def setup_model(model = :test_model) constantized = model.to_s.split("_").collect(&:capitalize).join unless Object.const_defined?(constantized) Temping.create model do with_columns do |t| t.integer :id_alt t.string :column1, :column2, :language, :language_alt end end include_acts_as_translatable Object.const_get(constantized) end end
setup_translation()
click to toggle source
# File test/test_helper.rb, line 48 def setup_translation unless Object.const_defined?("Translation") Temping.create :translation do with_columns do |t| t.integer :translatable_id t.string :translatable_type t.string :field t.string :language t.text :translation t.timestamps end end end end