Sha256: dbb43fc1e735520e3329df6f6e3ffa2a30b27791d70368500ae157f803859d5d

Contents?: true

Size: 642 Bytes

Versions: 2

Compression:

Stored size: 642 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

class AnnotationAttributeTest < ActiveSupport::TestCase
  
  def test_annotation_attribute_class_loaded
    assert_kind_of AnnotationAttribute, AnnotationAttribute.new
  end
  
  def test has_many_annotations_association
    assert_equal 6, annotations_attributes(:aa_tag).annotations.length
    assert_equal 1, annotations_attributes(:aa_contextualtag).annotations.length
  end
  
  def test_add_duplicates
    assert_not_nil AnnotationAttribute.find_by_name("tag")
    
    assert_raise ActiveRecord::RecordInvalid do
      AnnotationAttribute.create!(:name => 'Tag')
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
my_annotations-0.6.0 test/annotation_attribute_test.rb
my_annotations-0.5.1 test/annotation_attribute_test.rb