File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -138,15 +138,16 @@ def test_payload_connection_with_query_cache_disabled
138
138
def test_payload_connection_with_query_cache_enabled
139
139
connection = ClothingItem . lease_connection
140
140
141
- payloads = capture_notifications ( "sql.active_record" ) do
142
- assert_notifications_count ( "sql.active_record" , 2 ) do
143
- Book . cache do
144
- Book . first
145
- Book . first
146
- end
141
+ notifications = capture_notifications ( "sql.active_record" ) do
142
+ Book . cache do
143
+ Book . first
144
+ Book . first
147
145
end
148
- end . map ( &:payload )
146
+ end
147
+
148
+ payloads = notifications . select { _1 . payload [ :sql ] . match? ( "SELECT" ) } . map ( &:payload )
149
149
150
+ assert_equal 2 , payloads . size
150
151
assert_equal connection , payloads . first [ :connection ]
151
152
assert_equal connection , payloads . second [ :connection ]
152
153
end
You can’t perform that action at this time.
0 commit comments