Skip to content

Commit b31379e

Browse files
dr-itzkares
authored andcommitted
[test] fix query cache tests for Rail 5.1..6.0 (#991)
5.1 and higher changed the way cached queries are accounted for... Fixes #839
1 parent ae0b0a1 commit b31379e

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

test/simple.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,6 @@ def test_connection_valid
10351035
end
10361036

10371037
def test_query_cache
1038-
pend '#839 is open to resolve if this is really a valid test or not in 5.1' if ActiveRecord::Base.connection.adapter_name =~ /mysql|sqlite|postgres/i
10391038
user_1 = User.create! :login => 'query_cache_1'
10401039
user_2 = User.create! :login => 'query_cache_2'
10411040
user_3 = User.create! :login => 'query_cache_3'

test/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def initialize(ignored_sql = self.class.ignored_sql)
505505
end
506506

507507
def call(name, start, finish, message_id, values)
508-
return if 'CACHE' == values[:name]
508+
return if values[:cached]
509509

510510
sql = values[:sql]
511511
sql = sql.to_sql unless sql.is_a?(String)

0 commit comments

Comments
 (0)