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

Version Path
muck-contents-0.1.11 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.10 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.9 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.8 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.7 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.6 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.5 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.4 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.1 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.2 test/rails_root/test/unit/content_translation_test.rb
muck-contents-0.1.3 test/rails_root/test/unit/content_translation_test.rb
muck-raker-0.1.14 test/rails_root/test/unit/tag_cloud_test.rb
muck-raker-0.1.15 test/rails_root/test/unit/tag_cloud_test.rb