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

Store image meta data in arrays and adds unit tests #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Store image meta data in arrays and adds unit tests #43

wants to merge 1 commit into from

Conversation

achingbrain
Copy link

This pull request does a number of things (sorry):

  1. Lets you store upload meta data in array properties instead of just fields (attaching plugin to an Array #5)
  2. Adds a suite of unit tests to prevent future b0rkage
  3. Defaults to using the system temp directory for ImageMagick temporary files (Converted files polluting defaults directory #38)
  4. Adds the field name to the saved file (Overriding files when using more than one attachment field (r 0.0.4) #23)

To run the unit tests, do:

npm test

Then open coverage/lcov-report/index.html to see code coverage.

There was an existing test that looks at the output of ImageMagick to verify whether support for certain formats was enabled. I'd argue that this test should be removed as it's not testing mongoose-attachments code, rather an external dependency so can break due to circumstances out of our control, but I've converted it into a mocha unit test anyway pending further discussion.

@zeroth
Copy link

zeroth commented Jun 10, 2014

is this patch added to Master ?

@achingbrain
Copy link
Author

No, this pull request has not been merged.

If you like, check out mongoose-crate - it works along similar lines to mongoose-attachments and supports arrays of images among other things.

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

Successfully merging this pull request may close these issues.

None yet

2 participants