Reputation: 3862
I'm facing the issue to right test case for below mentioned function.
-(IBAction) returnToLogin:(UIStoryboardSegue*) segue {
NSLog(@"kiwi tested");
}
I have tried different ways but it's pass the test case
it(@"Should unwind segue", ^{
NSNumber *actionMethod = @([_vc respondsToSelector:@selector(returnToLogin:)]);
[[actionMethod should] beTrue];
});
Do you have any idea?
Upvotes: 0
Views: 133
Reputation: 32782
In the current implementation of returnToLogin:
you cannot test much, as the method is not doing anything. If the method would perform some actions, like changing the view controller hierarchy, then you would be able to assert on that behaviour.
But take into consideration the following:
IBAction
is not correct, an UIStoryboardSegue
cannot trigger an action.Upvotes: 0