JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
[Refactoring proposal] Test app structure refactoring
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Ruby
- Estrellas
- 2.3k
- Forks
- 546
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
This issue is a (choose one):
- Problem/bug report.
- Feature request.
- Refactor proposal
- Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.
Checklist before submitting:
- I've searched for an existing issue.
- I've asked my question on Gitter and have not received a satisfactory answer.
- I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.
- The feature I'm asking for is compliant with the JSON:API spec.
Description
Currently, we put all kind of components of our test app in side test/fixtures/active_record.rb. It contains schema, models, controllers and resources. The file’s name is quite misleading since it contains more than active_record related stuffs. And it’s a 2000 lines file, a little bit too long.
And in the meantime, test_helper.rb has the routes, test configurations, monkey-patches and test app configurations.
As a new contributor, I need to spend more time to figure out the test setup under this structure.
So I suggest we can do a small refactoring, to extract and put different types of components into their own files. Like:
test
|——— schema.rb # for schema
|——— models.rb # for models
|——— controllers.rb # for controllers
|——— resources.rb # for resources
|——— routes.rb # for routes
|——— app.rb # for app configs
|——— test_helper.rb # test configs, monkey-patchings and requires
Now we can just include these component files inside test_helper.rb and it’ll be more easier for new contributors to understand the test app.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza leyendo test/fixtures/active_record.rb y test_helper.rb para identificar el esquema, los modelos, los controladores, los recursos, las rutas, las configuraciones y los monkey-patches que contienen. Extrae cada tipo de componente a los archivos de prueba propuestos e inclúyelos desde test_helper.rb. Se considera terminado cuando la aplicación de prueba conserva su comportamiento y su estructura coincide con la disposición propuesta.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rails, ruby
- Área
- developer-experience, testing
- Tipo de issue
- Refactorización
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100