Add missing test cases for `attribute_names` instance method

There is a class method with the same name that is tested, but not the
instance method.