amberframework / amber

A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
https://amberframework.org
MIT License
2.58k stars 206 forks source link

`amber g ` creates system tests that are incomplete for controller/request testing #1320

Open crimson-knight opened 1 year ago

crimson-knight commented 1 year ago

When using the api generator like:

amber g api examplething name:string

Everything generates properly, however when you run the tests you'll get errors like:

response = subject.get "/examplething"

This is because the GarnetSpec::RequestHelper isn't being included in the controller test class that is being generated.

This is definitely being missed in our test coverage as well.

  1. Fix the generators to ensure everything generating a system/controller test is including the necessary module.
  2. Add test coverage to check that everything is being included in the generator files.
  3. Add a workflow to CircleCI that creates an amber app and then runs the generator and runs the spec suite. Everything for a brand new app should run without issue.