Skip to content

Remove the comments controller spec - #1296

Merged
amatsuda merged 1 commit into
rubycentral:mainfrom
amatsuda:drop_comments_controller_spec
Nov 19, 2026
Merged

amatsuda merged 1 commit into
rubycentral:mainfrom
amatsuda:drop_comments_controller_spec

Conversation

@amatsuda

Copy link
Copy Markdown
Collaborator

Summary

Third per-file conversion, and this one is a pure deletion: every example in spec/controllers/comments_controller_spec.rb already has a home that exercises the real code path.

Controller example Covered by
adds a public comment to the proposal spec/requests/comments_spec.rb "can post a public comment" (speaker and staff), which also checks the redirect back to the proposal and the authorization cases the controller spec never did
adds an internal comment spec/requests/comments_spec.rb "can post an internal comment"
sends an email notification to the speaker / to all speakers spec/models/public_comment_spec.rb #send_emails: one delivery addressed to every speaker. The mailer is invoked from the model's after_create, so that is where it belongs; the controller spec was stubbing it with a double.
does not send a notification email to the speaker (internal) spec/models/internal_comment_spec.rb: internal comments email only a mentioned teammate, and not even them when the preference is in-app only

Test

bin/rspec spec/requests/comments_spec.rb spec/models/public_comment_spec.rb spec/models/internal_comment_spec.rb: 27 examples, 0 failures.

🤖 Generated with Claude Code

Each of its five examples already has a home that exercises the real code
path:

- public and internal comment creation, with the redirect back to the
  proposal, in spec/requests/comments_spec.rb, which also covers the
  authorization cases the controller spec never did
- the speaker email on a public comment, including one email addressed
  to every speaker, in spec/models/public_comment_spec.rb, where the
  mailer is actually invoked
- internal comments only ever emailing a mentioned teammate, in
  spec/models/internal_comment_spec.rb

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@amatsuda
amatsuda merged commit a7a5a0a into rubycentral:main Nov 19, 2026
3 of 4 checks passed
@amatsuda
amatsuda deleted the drop_comments_controller_spec branch November 19, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant