Sha256: 3df2f02c4cebd81fc3bef3e98f4dfdb9be71693902e21bb5e41307bf957d50c1
Contents?: true
Size: 1.03 KB
Versions: 13
Compression:
Stored size: 1.03 KB
Contents
require File.dirname(__FILE__) + '/../test_helper' # Used to test muck_content_translation class ContentTranslationTest < ActiveSupport::TestCase context "A content translation instance" do should_belong_to :content should_have_named_scope :by_newest should_have_named_scope :recent should_have_named_scope :by_alpha should_have_named_scope :by_locale end context "find by locale" do setup do ContentTranslation.destroy_all @content_one = Factory(:content) @content_two = Factory(:content) end should "find two English translations" do translations = ContentTranslation.by_locale('en') assert_equal 2, translations.length end should "find two Spanish translations" do translations = ContentTranslation.by_locale('es') assert_equal 2, translations.length end should "delete translations" do assert_difference "ContentTranslation.count", -(@content_two.content_translations.count) do @content_two.destroy end end end end
Version data entries
13 entries across 13 versions & 2 rubygems