ActiveSupport::Notifications.subscribe('sql.active_record') seems a global subscription that affects other tests,so I added unsubscribe method after this test.
ActiveSupport::Notifications.subscribe('sql.active_record')