refactor duplicated code by using shared_examples
add application helper spec