Sha256: 50d21bb164f9859dfa2c7c80cbbc8b937b403ae3a55b78e01f2fdaa99d40563f
Contents?: true
Size: 913 Bytes
Versions: 2
Compression:
Stored size: 913 Bytes
Contents
require File.join(File.dirname(__FILE__), '..', 'og', 'CONFIG.rb') $DBG = true require 'test/unit' require 'og' require 'glue/orderable' class TestOgOrderable < Test::Unit::TestCase # :nodoc: all class Article is Glue::Orderable attr_accessor :body, String, :revisable => true attr_accessor :title, String def initialize(t, b) @title, @body = t, b end end $og1.manage_classes(Article) def test_all a1 = Article.create('hello', 'world') a2 = Article.create('another', 'one') a3 = Article.create('great', 'stuff') assert_equal 1, a1.position assert_equal 2, a2.position assert_equal 3, a3.position a2.move_higher a1 = Article.find_by_title('hello') a2 = Article.find_by_title('another') assert_equal 1, a2.position assert_equal 2, a1.position a1.orderable_position = 32 assert_equal 32, a1.position end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
og-0.41.0 | test/glue/tc_orderable2.rb |
og-0.40.0 | test/glue/tc_orderable2.rb |