AO3-7543 NoMethodError when using mark_as_spam on comments with deleted commenters - #5948
Open
omerfaruk-pseud wants to merge 2 commits into
Open
AO3-7543 NoMethodError when using mark_as_spam on comments with deleted commenters#5948omerfaruk-pseud wants to merge 2 commits into
omerfaruk-pseud wants to merge 2 commits into
Conversation
Bilka2
reviewed
Jul 28, 2026
| let(:user) { create(:user) } | ||
| let(:comment) { create(:comment, pseud: user.default_pseud, approved: true, spam: false) } | ||
|
|
||
| before { user.delete } |
Contributor
There was a problem hiding this comment.
Note for myself: This is using delete because using destroy would mean the comment doesn't actually get created with the user etc, since when running the test the user would be destroyed before the comment is created (and Rails would be aware of that, as opposed to delete doing it directly in the DB).
Bilka2
approved these changes
Jul 28, 2026
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.
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7543
Purpose
Tries the login method on user so it doesn't raise
NoMethodErrorif the user doesn't existCredit
ömer faruk (he/him)