Rewritten integration test using Promises