Makes visible scopes accept projects option and deprecate Project.visible_by.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5324 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -106,6 +106,22 @@ class IssueTest < ActiveSupport::TestCase
|
||||
assert issues.detect {|issue| !issue.project.is_public?}
|
||||
end
|
||||
|
||||
def test_visible_scope_with_project
|
||||
project = Project.find(1)
|
||||
issues = Issue.visible(User.find(2), :project => project).all
|
||||
projects = issues.collect(&:project).uniq
|
||||
assert_equal 1, projects.size
|
||||
assert_equal project, projects.first
|
||||
end
|
||||
|
||||
def test_visible_scope_with_project_and_subprojects
|
||||
project = Project.find(1)
|
||||
issues = Issue.visible(User.find(2), :project => project, :with_subprojects => true).all
|
||||
projects = issues.collect(&:project).uniq
|
||||
assert projects.size > 1
|
||||
assert_equal [], projects.select {|p| !p.is_or_is_descendant_of?(project)}
|
||||
end
|
||||
|
||||
def test_errors_full_messages_should_include_custom_fields_errors
|
||||
field = IssueCustomField.find_by_name('Database')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user