rails-templates icon indicating copy to clipboard operation
rails-templates copied to clipboard

Improve how to test generated project

Open rosle opened this issue 2 years ago • 1 comments

Why

Sometimes when working on the addon, we need to test the generated app if it works. Usually, we create some basic controller view, add style and javascript to test. 🕵️

To avoid this repetitive step, we can make a patch and keep applying it on the generated project.

  • Create basic controller and view with basic stylesheet and javascript
  • Make a patch file of the diff
  • Commit it to the template, so everyone can reuse it
  • Add instruction into template readme / wiki

Who Benefits?

Developers who work on the template

rosle avatar Mar 18 '22 05:03 rosle

I faced the same challenges, but as we are now building the CRUD add-on, the flow might be much easier:

  • scaffold an app with the CRUD addon
  • use the generate command to add model/view/controllers/...
  • and voila!

So I recommend updating this story with

  • Add a create_test_app make command
  • Document how to quickly generate an app (make create_test_app, cd test_app, rails g crud device name:string price:float description:text, make dev, ...) or eventually provide a script that does it all-at-once

malparty avatar Jan 11 '24 04:01 malparty