from tutorial http://www.raywenderlich.com/22590/beginning-automated-testing-with-xcode-part-12