Project

General

Profile

Defect #37925 ยป fix_query_display_type.patch

Alexander Meindl, 2022-11-12 17:48

View differences:

app/models/query.rb
end
def display_type=(type)
unless type || self.available_display_types.include?(type)
unless type && self.available_display_types.include?(type)
type = self.available_display_types.first
end
options[:display_type] = type
test/unit/query_test.rb
assert_equal 1, query.issue_count
end
def test_display_type_should_accept_known_types
query = ProjectQuery.new(:name => '_')
query.display_type = 'list'
assert_equal 'list', query.display_type
end
def test_display_type_should_not_accept_unknown_types
query = ProjectQuery.new(:name => '_')
query.display_type = 'invalid'
assert_equal 'board', query.display_type
end
end
    (1-1/1)