Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for changes from #937: ignoring 3rd party load failures whi…
…le redirecting (#945) * Add tests for changes from #937: ignoring 3rd party load failures while redirecting I didn't realize that `STPRedirectContext` was as well tested as it is. I ran into test failures when executing on iOS 10 (our CI executes against iOS 11), and realized this needed to be updated. Recap of behavior change: only report errors in initial load on iOS 11+, and only if the latest URL was a `stripe.com` URL. When unit tests were run against iOS 11, this was still true, and the existing test passed. This adds two more tests: for pre-iOS 11 and for iOS 11 with a redirect to non-stripe.com. Both of those cases should not report an error, and should not close the Safari View Controller. We don't have `guard-let` in Obj-C, nor can we check `!@available(...)`, but I have emulated that structure at the beginning of these tests. I think it's worth it, and Joey didn't think it was unreasonable. * Add missing calls to `unsubscribeContext:` in `STPRedirectContextTest` Per documentation at the top of the class: > [If] Your `sut` doesn't call unsubscribe and you explicitly `OCMReject` it firing > [Then] call `[self unsubscribeContext:context]` at the end of your test (use the original > `context` object here and _NOT_ the `sut` or it will not work). I missed that in one of the tests I just added, and while auditing all the tests I found another one that wasn't unsubscribing.
- Loading branch information