refactor rspec tests, use shared example and ApplicationHelper test.