Commit f3e0fd2d authored by jplang's avatar jplang

Ruby 2.4: Fixed "Fixnum is deprecated" warning in QueryTest. (#25048).

Patch by Go MAEDA.

git-svn-id: https://svn.redmine.org/redmine/trunk@16355 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent ba141df5
......@@ -32,6 +32,8 @@ class QueryTest < ActiveSupport::TestCase
:workflows,
:attachments
INTEGER_KLASS = RUBY_VERSION >= "2.4" ? Integer : Fixnum
def setup
User.current = nil
end
......@@ -1612,7 +1614,7 @@ class QueryTest < ActiveSupport::TestCase
count_by_group = q.issue_count_by_group
assert_kind_of Hash, count_by_group
assert_equal %w(NilClass User), count_by_group.keys.collect {|k| k.class.name}.uniq.sort
assert_equal %w(Fixnum), count_by_group.values.collect {|k| k.class.name}.uniq
assert_equal %W(#{INTEGER_KLASS}), count_by_group.values.collect {|k| k.class.name}.uniq
assert count_by_group.has_key?(User.find(3))
end
......@@ -1621,7 +1623,7 @@ class QueryTest < ActiveSupport::TestCase
count_by_group = q.issue_count_by_group
assert_kind_of Hash, count_by_group
assert_equal %w(NilClass String), count_by_group.keys.collect {|k| k.class.name}.uniq.sort
assert_equal %w(Fixnum), count_by_group.values.collect {|k| k.class.name}.uniq
assert_equal %W(#{INTEGER_KLASS}), count_by_group.values.collect {|k| k.class.name}.uniq
assert count_by_group.has_key?('MySQL')
end
......@@ -1630,7 +1632,7 @@ class QueryTest < ActiveSupport::TestCase
count_by_group = q.issue_count_by_group
assert_kind_of Hash, count_by_group
assert_equal %w(Date NilClass), count_by_group.keys.collect {|k| k.class.name}.uniq.sort
assert_equal %w(Fixnum), count_by_group.values.collect {|k| k.class.name}.uniq
assert_equal %W(#{INTEGER_KLASS}), count_by_group.values.collect {|k| k.class.name}.uniq
end
def test_issue_count_with_nil_group_only
......
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