Fix 632#806
Merged
Merged
Conversation
|
@kodegreen70 is attempting to deploy a commit to the oseh-svg's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@kodegreen70 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@kodegreen70 please fix merge conflict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add cancel_subscription test coverage
Closes #632
Summary
cancel_subscriptionis an admin-only function with several distinct code paths — subscription not found, successful cancellation, and unauthorized caller — none of which had dedicated tests. This PR adds the three missing cases to lock in the existing behaviour before any future changes.Changes
contract/contracts/pro_subscription/src/test.rsThree new tests added under the
Issue #632section:test_cancel_subscription_successis_pro_memberreturnsfalseand the stored record hasis_active = falsetest_cancel_subscription_not_foundcancel_subscriptionfor an address that never subscribed returnsSubscriptionNotFoundtest_cancel_subscription_unauthorized#[should_panic]), matching the pattern used by other unauthorized tests in the suiteNo production code was changed — this is a test-only addition.
How to Test
cargo test -p pro-subscriptionAll pre-existing tests continue to pass alongside the three new ones.
Acceptance Criteria
test_cancel_subscription_successexists and passestest_cancel_subscription_not_foundexists and passestest_cancel_subscription_unauthorizedexists and passescargo test -p pro-subscriptionexits with code 0