Commit 80dff360 authored by marutosijp's avatar marutosijp

remove Rails4 deprecated Relation#all from...

remove Rails4 deprecated Relation#all from IssueTest#test_visible_and_nested_set_scopes and add awesome_nested_set regression test

git-svn-id: e93f8b46-1217-0410-a6f0-8f06a7374b81
parent cfa00f0c
......@@ -330,7 +330,23 @@ class IssueTest < ActiveSupport::TestCase
def test_visible_and_nested_set_scopes
assert_equal 0, Issue.find(1).descendants.visible.all.size
user = User.generate!
parent = Issue.generate!(:assigned_to => user)
assert parent.visible?(user)
child1 = Issue.generate!(:parent_issue_id =>, :assigned_to => user)
child2 = Issue.generate!(:parent_issue_id =>, :assigned_to => user)
assert child1.visible?(user)
assert child2.visible?(user)
assert_equal 2, parent.descendants.count
assert_equal 2, parent.descendants.visible(user).count
# awesome_nested_set 2-1-stable has regression.
# ActiveRecord::StatementInvalid: SQLite3::SQLException: ambiguous column name: lft:
assert_equal 2, parent.descendants.collect{|i| i}.size
assert_equal 2, parent.descendants.visible(user).collect{|i| i}.size
def test_open_scope
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment