Testing gravity against the early time integrated Sachs-Wolfe effect