Sha256: 5bcf4b5376d9c653a0d677725e6b125094c2a42bcbfbb393eb1730e0d4ce96d0
Contents?: true
Size: 1.04 KB
Versions: 18
Compression:
Stored size: 1.04 KB
Contents
require 'test_helper' module CollectiveIdea module Acts #:nodoc: module NestedSet #:nodoc: class AwesomeNestedSetTest < TestCaseClass include Helper fixtures :categories def test_nested_set_options expected = [ [" Top Level", 1], ["- Child 1", 2], ['- Child 2', 3], ['-- Child 2.1', 4], ['- Child 3', 5], [" Top Level 2", 6] ] actual = nested_set_options(Category) do |c| "#{'-' * c.level} #{c.name}" end assert_equal expected, actual end def test_nested_set_options_with_mover expected = [ [" Top Level", 1], ["- Child 1", 2], ['- Child 3', 5], [" Top Level 2", 6] ] actual = nested_set_options(Category, categories(:child_2)) do |c| "#{'-' * c.level} #{c.name}" end assert_equal expected, actual end end end end end
Version data entries
18 entries across 18 versions & 4 rubygems