added devise and updated tests