Skip to content

Instantly share code, notes, and snippets.

@klaaspieter
Created May 22, 2014 20:22
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 klaaspieter/2c2923fe3d8ea64ca103 to your computer and use it in GitHub Desktop.
Save klaaspieter/2c2923fe3d8ea64ca103 to your computer and use it in GitHub Desktop.
describe(@"when the retry button is tapped", ^{
before(^{
_fetcher = mock([ProductFetcher class]);
_viewController.productFetcher = _fetcher;
[_viewController.errorView.button sendActionsForControlEvents:UIControlEventTouchUpInside];
});
it(@"retries fetching the products", ^{
[verify(_fetcher) fetch];
});
it(@"has a visible loading view", ^{
expect(_viewController.loadingView).to.beVisible();
});
it(@"has a hidden error view", ^{
expect(_viewController.errorView).to.beInvisible();
});
it(@"has a hidden content view", ^{
expect(_viewController.contentView).to.beInvisible();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment