Add test for unregistering device