diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/fixtures/mixins.yml | 18 | ||||
-rw-r--r-- | activerecord/test/mixin_test.rb | 6 |
2 files changed, 14 insertions, 10 deletions
diff --git a/activerecord/test/fixtures/mixins.yml b/activerecord/test/fixtures/mixins.yml index e326f6675e..49297cc241 100644 --- a/activerecord/test/fixtures/mixins.yml +++ b/activerecord/test/fixtures/mixins.yml @@ -1,30 +1,30 @@ # tree mixins tree_1: - id: 1 + id: 1001 type: TreeMixin parent_id: 0 tree_2: - id: 2 + id: 1002 type: TreeMixin - parent_id: 1 + parent_id: 1001 tree_3: - id: 3 + id: 1003 type: TreeMixin - parent_id: 2 + parent_id: 1002 tree_4: - id: 4 + id: 1004 type: TreeMixin - parent_id: 1 + parent_id: 1001 # List mixins <% (1..4).each do |counter| %> list_<%= counter %>: - id: <%= counter+6 %> + id: <%= counter+1006 %> pos: <%= counter %> type: ListMixin parent_id: 5 -<% end %>
\ No newline at end of file +<% end %> diff --git a/activerecord/test/mixin_test.rb b/activerecord/test/mixin_test.rb index 01b16cc631..db9695930e 100644 --- a/activerecord/test/mixin_test.rb +++ b/activerecord/test/mixin_test.rb @@ -174,7 +174,11 @@ class TreeTest < Test::Unit::TestCase assert @extra assert_equal @extra.parent, @tree_1 - assert_equal [@tree_2, @tree_4, @extra], @tree_1.children + + assert_equal 3, @tree_1.children.size + assert @tree_1.children.include?(@extra) + assert @tree_1.children.include?(@tree_2) + assert @tree_1.children.include?(@tree_4) end |