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

Document the structure of fixture files #49

Open
axelpale opened this issue Sep 6, 2016 · 3 comments
Open

Document the structure of fixture files #49

axelpale opened this issue Sep 6, 2016 · 3 comments

Comments

@axelpale
Copy link

axelpale commented Sep 6, 2016

As a newcomer to Sails and Barrels, I had a hard time to figure out in which format the fixtures should be. I kept thinking how should I create the fixtures, should I just wrote the files, in which format, et cetera. By consuming time to examine the files under test/fixtures/, I now know that they have a structure that is somehow related to the model attributes.

What do you think, is the documentation lacking in this matter? Even a tiny example.json fixture in the README.md with proper description might do the job.

@bredikhin
Copy link
Owner

No problem, feel free to submit a pull request.

@axelpale
Copy link
Author

axelpale commented Sep 6, 2016

@bredikhin Thank you for the quick reply. Currently I do not have enough knowledge about the required fixture files to write documentation about them but if that day comes, I might submit a PR. Should the fixtures always be arrays of objects? Should the properties of the objects match the attributes of Sails Models? Is there some special properties? For example, the model test/fixtures/models/Product.js has attribute name, and the fixture product.js uses property title. Is either one a special value? What if some of the attributes are not given? Is it necessary to give all the attributes?

I am sorry for being difficult, so to say, but I am trying to express the variety of questions running in the mind of a dev that is new to Sails and Barrels.

@bredikhin
Copy link
Owner

The best way to learn is to actually read the code and the existing docs. I'm pretty sure it'll let you come up with a good level of understanding and maybe a comprehensive PR if you feel like it.

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

2 participants