Use open scope in version issues count methods.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8285 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-12-18 13:05:46 +00:00
parent 76ad136b2a
commit 2a0257e8af
3 changed files with 16 additions and 3 deletions
+10
View File
@@ -219,6 +219,16 @@ class IssueTest < ActiveSupport::TestCase
assert_equal 0, Issue.find(1).descendants.visible.all.size
end
def test_open_scope
issues = Issue.open.all
assert_nil issues.detect(&:closed?)
end
def test_open_scope_with_arg
issues = Issue.open(false).all
assert_equal issues, issues.select(&:closed?)
end
def test_errors_full_messages_should_include_custom_fields_errors
field = IssueCustomField.find_by_name('Database')