Sha256: deef9f4e169472203493c9968de1768dd0c91ea3d14a3148cc748fb40df3a439

Contents?: true

Size: 567 Bytes

Versions: 2

Compression:

Stored size: 567 Bytes

Contents

require File.join(File.dirname(__FILE__), 'CONFIG.rb')

require 'test/unit'

require 'rubygems'
require 'og'

class TC_Loop < Test::Unit::TestCase
  class ManagedClass
    attr_accessor :thing, String

    validate_unique :thing
  end
  
  $og1.manage_class ManagedClass
  
  def setup
    @thing_1 = ManagedClass.new
    @thing_1.thing = 'thing'
    @thing_1.save
  end
  
  def teardown
    ManagedClass.delete_all
  end

  def test_loop
    thing_2 = ManagedClass.new
    thing_2.thing = @thing_1.thing
    
    thing_2.valid?
    assert thing_2.errors
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
og-0.41.0 test/og/tc_validation_loop.rb
og-0.40.0 test/og/tc_validation_loop.rb