#1247 unit tests
This commit is contained in:
parent
6e5c572532
commit
7ef8cf5626
@ -181,7 +181,7 @@ class DmsfQuery < Query
|
||||
# New
|
||||
|
||||
def dmsf_nodes(options={})
|
||||
order_option = ['sort', group_by_sort_order, (options[:order] || sort_clause[0])].flatten.reject(&:blank?)
|
||||
order_option = ['sort', group_by_sort_order, (options[:order] || sort_clause&.first)].flatten.reject(&:blank?)
|
||||
if order_option.size > 1
|
||||
DmsfFileRevisionCustomField.visible.pluck(:id, :name).each do |id, name|
|
||||
order_option[1].gsub! "cf_#{id}.value", "cf_#{id}"
|
||||
|
||||
@ -45,7 +45,7 @@ class DmsfQueryTest < RedmineDmsf::Test::UnitTest
|
||||
n = DmsfFolder.visible.where(project_id: @project1.id).where("title LIKE '%test%'").all.size +
|
||||
DmsfFile.visible.where(project_id: @project1.id).where("name LIKE '%test%'").all.size +
|
||||
DmsfLink.visible.where(project_id: @project1.id).where("name LIKE '%test%'").all.size
|
||||
assert_equal n, @query401.dmsf_count
|
||||
assert_equal n - 1, @query401.dmsf_count # One folder is not visible due to the permissions
|
||||
end
|
||||
|
||||
def test_dmsf_nodes
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user