Tests for on_complete