Sha256: 4de66ee47025bf9e344fc5aa7ccd6c22492ff871280710d815f8053a07124b8d

Contents?: true

Size: 736 Bytes

Versions: 10

Compression:

Stored size: 736 Bytes

Contents

require File.expand_path('../test_helper', File.dirname(__FILE__))

class TaggingTest < ActiveSupport::TestCase
  
  def test_fixtures_validity
    Blog::Tagging.all.each do |tagging|
      assert tagging.valid?, tagging.errors.to_s
    end
  end
  
  def test_destroy_for_tag
    assert_difference ['Blog::Tagging.count', 'Blog::Tag.count'], -1 do
      blog_taggings(:tag).destroy
    end
  end
    
  def test_destroy_for_category
    assert_difference 'Blog::Tagging.count', -1 do
      assert_no_difference 'Blog::Tag.count' do
        blog_taggings(:category).destroy
      end
    end
  end
  
  def test_scopes
    assert_equal 1, Blog::Tagging.for_tags.count
    assert_equal 1, Blog::Tagging.for_categories.count
  end
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
comfy_blog-0.1.8 test/unit/tagging_test.rb
comfy_blog-0.1.7 test/unit/tagging_test.rb
comfy_blog-0.1.6 test/unit/tagging_test.rb
comfy_blog-0.1.5 test/unit/tagging_test.rb
comfy_blog-0.1.4 test/unit/tagging_test.rb
comfy_blog-0.1.3 test/unit/tagging_test.rb
comfy_blog-0.1.2 test/unit/tagging_test.rb
comfy_blog-0.1.1 test/unit/tagging_test.rb
comfy_blog-0.1.0 test/unit/tagging_test.rb
comfy_blog-0.0.0 test/unit/tagging_test.rb