Commit Graph

12 Commits

Author SHA1 Message Date
Hannah Wolfe
1ed286d09e Merge pull request #3866 from hswolff/config-updates
Move config module to be instance based and merge bootstrap into config.
2014-08-29 21:35:56 +01:00
Hannah Wolfe
93e4cfdadf Merge pull request #3855 from felixrieseberg/iss3844-importer
Importer: Sanitize UUIDs
2014-08-26 16:51:49 +01:00
Felix Rieseberg
6fe93f6a50 Importer: Sanitize UUIDs
Closes #3844
- Before importing, all data is checked for incorrect UUIDs. If check
fails, data is sanitized and outfitted with correct UUIDS.
- Scaffolding allows for easy implementation of additional
sanitization, should that be required in the future.
- Test included, old tests updated.
2014-08-23 18:02:23 -07:00
Harry Wolff
583c7970d9 Move config module to be instance based and merge bootstrap into config.
helps with #827, otherwise no issue

- This is general code clean-up and unification.
- Merges code from bootstrap.js into config module as they were both
concerned with managing the config file and as such should be in one
location.
- Updates all relevant tests.
2014-08-23 15:54:43 -04:00
Jason Williams
07ad400ee0 Replace the when promise library with bluebird.
Closes #968
2014-08-23 17:15:40 +00:00
Jason Williams
74fd6fc09a Change tests to accommodate pg differences.
Refs #2499
- Since PostgreSQL handles transactions differently than
  MySQL and SQLite3 there are differences in the way and
  number of errors that are returned.  Update tests to
  only check that at least one error of the proper type
  was returned.
2014-08-20 20:58:50 +00:00
Hannah Wolfe
2d2e61676d MU Importer - Assign objects correctly
fixes #3716

- change the importer to not override any user details
- only set published_by if it is not already set
- import users before anything else
- process the import and map user ids to existing users
- test fix - owner should have owner role
- test fix - catch invalid success in importer
2014-08-10 14:49:23 +01:00
Jason Williams
18d12290ff Add catch handlers to import tests.
Refs #3473
- Some tests are checking to make sure errors by using a
  catch handler on the test.  When assertions fail done()
  is never called and results in a mocha timeout, which makes
  it harder to see the cause of the failure.
2014-08-05 18:01:24 +00:00
Hannah Wolfe
756368721e Update importer for MU
closes #3285

- remove apps stuff for now
- if there is a single user, behave the same as before, overriding
  non-critical properties of the single owner user
- if there are multiple users, import them like normal resource
2014-07-31 23:14:57 +01:00
Jacob Gable
69b871a754 Make importer more robust for tags
Closes #3242

- Add checks for valid fields in tags and posts
- Add unit test with empty tag export data file
- Add unit test with empty post export data file
2014-07-30 22:33:45 -05:00
Hannah Wolfe
0ffc5e6d47 Improve importer error messaging
closes #3274

- Ensure that validation errors are always handled by moving them into the
  importer
- Ensure that db errors are handled consistently across sqlite and mysql
- Change the errors to be output in a table, with a short failure notification
- Add tests for 003 importing bad files
2014-07-29 12:02:18 +01:00
Hannah Wolfe
337713ce63 Refactor fixture use in tests
no issue

- Refactor all integration tests to specify and load ONLY the fixtures
  they require to run, rather than initialising the whole kit-and-kaboodle
  for every single test which takes FOREVER.
- Refactor the route tests to share a doAuth function, and also specify
  additional fixtures required
- Move import and export unit tests, which are actually integration tests
  (they touch the DB)
- Comment out most of the permissions unit tests for now as they need more
  stubs/mocks so as to not touch the DB

Still todo:

- prevent default DB initialisation in route tests, and specify all
  fixtures requires as per the integration tests
- fix up the unit/permissions_spec
2014-07-23 05:04:50 +01:00