created method and test for select_all