Add attach / detach tests