Add tests for attrs_ha && extract last_controller assignment to attrs_ha method

unit-tests