I’m posting a CSV file from my front end to my backend API, and I’d like to write a unit test using ActionController::TestCase. In Rails 2 and 3 there was a helper, but it doesn’t seem to exist in Rails 6…
Any pointers, or am I thinking about this wrong?
In Rails 7 tests are based on ActiveSupport::TestCase. Controller tests extend that with ActionDispatch::IntegrationTest. See Testing Rails Applications — Ruby on Rails Guides.
ActiveSupport::TestCase
ActionDispatch::IntegrationTest
You can use fixture_file_upload fixture_file_upload (ActionController::TestProcess) - APIdock
fixture_file_upload
Thank you for this…!!!