refactoring app_spec.rb