Skip to content

AO3-7543 NoMethodError when using mark_as_spam on comments with deleted commenters - #5948

Open
omerfaruk-pseud wants to merge 2 commits into
otwcode:masterfrom
omerfaruk-pseud:AO3-7543
Open

AO3-7543 NoMethodError when using mark_as_spam on comments with deleted commenters#5948
omerfaruk-pseud wants to merge 2 commits into
otwcode:masterfrom
omerfaruk-pseud:AO3-7543

Conversation

@omerfaruk-pseud

Copy link
Copy Markdown
Member

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-7543

Purpose

Tries the login method on user so it doesn't raise NoMethodError if the user doesn't exist

Credit

ömer faruk (he/him)

@github-actions github-actions Bot added Scope: Tests Only Only changes automated tests or test configuration Awaiting Review labels Jul 26, 2026
@omerfaruk-pseud omerfaruk-pseud removed the Scope: Tests Only Only changes automated tests or test configuration label Jul 26, 2026
let(:user) { create(:user) }
let(:comment) { create(:comment, pseud: user.default_pseud, approved: true, spam: false) }

before { user.delete }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants