Skip to content

Instantly share code, notes, and snippets.

@chelseatroy
Last active January 25, 2017 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chelseatroy/2bd9ae2c9f017c21c711b4ac6c79d659 to your computer and use it in GitHub Desktop.
Save chelseatroy/2bd9ae2c9f017c21c711b4ac6c79d659 to your computer and use it in GitHub Desktop.
Test Screen Transition iOS
import XCTest
import Hamcrest
@testable import MyExampleApp
class ExampleViewControllerTest: XCTestCase {
...
func testNavigatesToOtherScreen() {
let controller = ExampleViewController.loadFromStoryboard()
assertThat(controller.view, present())
UIWindow.present(viewController: controller) { () in
controller.didTapButtonToGoToOtherViewController(NSObject())
assertThat(controller.presentedViewController, presentAnd(instanceOf(OtherViewController)))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment