refactoring user_actions and spec_helper