MushroomObserver / mushroom-observer

A website for sharing observations of mushrooms.
https://mushroomobserver.org
MIT License
78 stars 25 forks source link

Break up `ObservationsControllerTest` #2249

Closed nimmolo closed 2 months ago

nimmolo commented 2 months ago

This breaks up the 3000+ line test into files for each action, thankfully without needing to duplicate helper methods. There's also a file for list/project tests, which are very long by themselves.

The key line to add, so Rails is able to understand which controller it's testing, is this:

class ObservationsControllerUpdateTest < FunctionalTestCase
  tests ObservationsController # <-- this right here

Reason: rubocop takes a long time to get thru the single file, and it can be hard to find what you're looking for.