Closed gdean123 closed 8 years ago
@gdean123 - I'm wondering now what this line is doing:
subject = self.instantiateController("PaymentsViewController", storyboardName: "Payment") as! PaymentsViewController
Seems like maybe some helper method on SwinjectSpec
? What is it doing with that storyboard name? If it's spinning up an instance of a UIStoryboard
under the covers, that would explain why the binding doesn't seem to be working.
I'll look at Fleet's unit testing right now to verify that it's covering this case.
(Sorry, hit the wrong button 😅 )
Sorry about that - I didn't realize that we had written that method. Here is what instantiateController does:
class SwinjectSpec: QuickSpec {
let testContainer = Container()
func instantiateController(controllerName: String, storyboardName: String) -> UIViewController {
let storyboard = SwinjectStoryboard.create(name: storyboardName, bundle: nil, container: testContainer)
let controller = storyboard.instantiateViewControllerWithIdentifier(controllerName)
return controller
}
}
@gdean123 - I'm going to close this for now, as it seems like maybe that code listed in your last comment is what was causing your issues. If that turns out to be false, please let me know and we can reopen.
We are attempting to use Fleet's bindViewController to mock out view controllers that we segue to in our tests. Unfortunately, the assertions that we make to prove that we have performed the segue do not seem to work:
Here is approximately what our implementation looks like:
We are doing this on a view controller that has a direct segue from PaymentsViewController to the CreditCardViewController.
Maybe a sample project would be helpful to show how this is done?