bullet-train-co / bullet_train

The Open Source Ruby on Rails SaaS Template
MIT License
1.66k stars 262 forks source link

Adding a new role breaks the test suite #769

Open jagthedrummer opened 1 year ago

jagthedrummer commented 1 year ago

Adding any new role to roles.yml will cause the test suite to start failing with errors like this:

Error:
Account::Scaffolding::AbsolutelyAbstract::CreativeConcepts::CollaboratorsControllerTest#test_should_get_edit:
ActionView::Template::Error: translation missing: en.scaffolding/absolutely_abstract/creative_concepts/collaborators.fields.role_ids.options.team_admin.label
    test/controllers/account/scaffolding/absolutely_abstract/creative_concepts/collaborators_controller_test.rb:45:in `block in <class:CollaboratorsControllerTest>'

Maybe there should be a rake task for generating a role? That way we could scaffold the correct translation keys.

jagthedrummer commented 1 year ago

I got tests working again by cramming this into a locale file:

en:
  scaffolding/absolutely_abstract/creative_concepts/collaborators:
    fields:
      role_ids:
        options:
          project_admin:
            label: Project Admin
          team_admin:
            label: Team Admin
          billing_admin:
            label: Billing Admin

It feels weird as an app maintainer to have to care about anything related to scaffolding/absolutely_abstract/creative_concepts if I'm not developing on BT internals.