ruby-on-railsruby-on-rails-5ruby-on-rails-5.2

Where to save customized functional_test template?


I want to customize the controller test which is generated by rails g scaffold. I found the template file at

https://github.com/rails/rails/blob/master/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt

After downloading it I made the changes I want to apply but have no idea in which directory I have to save it. Which one is the correct one so that I can use it in my Rails project?

Rails Version: 5.2


Solution

  • this is the proper place for Rails 7.2:

    lib/templates/test_unit/scaffold/functional_test.rb.tt