Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We should generate tests for the account level controller when super scaffolding #864

Open
jagthedrummer opened this issue Jun 19, 2024 · 0 comments

Comments

@jagthedrummer
Copy link
Contributor

If you super scaffold a model we'll generate a tests for the api controller that we generate, but we do not generate a test for the user-facing controller. It would be nice if we did.

For instance, if you run this:

rails g super_scaffold List Team name:text_field --navbar="ti ti-list"

Then we generate a bunch of files, two of which are controllers:

app/controllers/account/lists_controller.rb
app/controllers/api/v1/lists_controller.rb

But we only generate one controller test:

test/controllers/api/v1/lists_controller_test.rb

The api controller test is based on test/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller_test.rb in the starter repo: https://github.com/bullet-train-co/bullet_train/blob/main/test/controllers/api/v1/scaffolding/completely_concrete/tangible_things_controller_test.rb

The starter repo also has an account level test at test/controllers/account/scaffolding/completely_concrete/tangible_things_controller_test.rb: https://github.com/bullet-train-co/bullet_train/blob/main/test/controllers/account/scaffolding/completely_concrete/tangible_things_controller_test.rb

Maybe we can use that as the template for a test for the user-facing controller?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant