Added integration test to ensure that order of operations is correct