Closed mirandawang closed 3 years ago
I've created a Pull request (https://github.com/Terrastories/terrastories/pull/551) to try to ensure places cannot be duplicated through the CSV importer, after adding the spec found that this cannot happen but having the spec may be useful for the future.
Thanks for digging into this, @jaimevelaz — since the PR you opened was merged, I'm going to close this issue.
For Places, admin are able to upload a CSV to bulk import data. However duplicate items can get added. Let’s update the import code so that duplicate items cannot be added.
Match on all fields. If this EXACT record already exists, do not recreate it. Just move on to the next row.
Sample CSV file: https://drive.google.com/file/d/1Ir6TC5THEoQKk-98JZ5KpTjXd-R6yMmA/view
Importer code for Places
You can log into the admin interface using the sample admin account from the db seeds.
Acceptance Criteria: When using the CSV importer, duplicate rows that have the same exact fields do not get added twice. Add unit tests for this behavior in each place_spec.rb