Sha256: bdacc44df550942bd5782ea453b7d117ec5855514b2c331d52e722559faa0ce7
Contents?: true
Size: 986 Bytes
Versions: 1
Compression:
Stored size: 986 Bytes
Contents
require 'spec_helper' require 'ar_schema' ARSchema.connect! describe "lolita_translation:sync_tables" do def translations ActiveRecord::Base.connection.tables.reject{|tn| !tn.match(/translations/)}.sort end before(:each) do c_class = Class.new(ActiveRecord::Base) stub_const('Comment',c_class) c_class.class_eval do include Lolita::Translation translate :body end ActiveRecord::Base.connection.execute("DROP TABLE comments_translations") rescue nil end it "should create translation tables for all lolita mappings" do translations.should eq(%w(categories_translations posts_translations products_translations).sort) Lolita.mappings[:comment] = Lolita::Mapping.new(:comments) load(File.expand_path("lib/tasks/lolita_translation.rake")) Rake::Task["lolita_translation:sync_tables"].invoke translations.should eq(%w(categories_translations posts_translations comments_translations products_translations).sort) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lolita-translation-0.8.4 | spec/tasks/lolita_translation_spec.rb |