apidae 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/app/assets/config/manifest.js +1 -0
- data/app/models/apidae/apidae_data_parser.rb +16 -7
- data/app/models/apidae/file_import.rb +12 -5
- data/app/models/apidae/obj.rb +16 -9
- data/config/initializers/constants.rb +5 -2
- data/lib/apidae/version.rb +1 -1
- data/test/data/shared_selections.json +15 -0
- data/test/dummy/log/development.log +281 -0
- data/test/dummy/log/test.log +5185 -0
- data/test/models/apidae/file_import_test.rb +23 -0
- metadata +6 -3
|
@@ -166,6 +166,29 @@ module Apidae
|
|
|
166
166
|
assert_equal 0, Selection.count
|
|
167
167
|
end
|
|
168
168
|
|
|
169
|
+
test "object deletion cancelled if used by another project" do
|
|
170
|
+
proj = Project.create(apidae_id: 123)
|
|
171
|
+
other_proj = Project.create(apidae_id: 456)
|
|
172
|
+
sel = Selection.create(apidae_id: 49063, apidae_project_id: proj.id, label: 'Sélection 2', reference: 'selection-2')
|
|
173
|
+
other_sel = Selection.create(apidae_id: 49999, apidae_project_id: other_proj.id, label: 'Sélection 99', reference: 'selection-99')
|
|
174
|
+
sel.objects << Obj.create(apidae_id: 503, title: 'Société des violoncellistes aixois')
|
|
175
|
+
sel.objects << Obj.create(apidae_id: 504, title: 'Société des contrebassistes aixois')
|
|
176
|
+
other_sel.objects << Obj.find_by_apidae_id(504)
|
|
177
|
+
|
|
178
|
+
assert_equal 2, sel.objects.count
|
|
179
|
+
assert_equal 1, other_sel.objects.count
|
|
180
|
+
|
|
181
|
+
selections_json = File.read('test/data/shared_selections.json')
|
|
182
|
+
FileImport.add_or_update_selections(proj, selections_json, @result)
|
|
183
|
+
deletion_json = File.read('test/data/deletion.json')
|
|
184
|
+
FileImport.delete_objects(deletion_json, @result)
|
|
185
|
+
|
|
186
|
+
assert_equal 2, Obj.count
|
|
187
|
+
assert_equal({created: 0, updated: 0, deleted: 1, selections:
|
|
188
|
+
[{:apidae_id=>49063, :reference=>"selection-2", :objects=>1}]}, @result)
|
|
189
|
+
assert_equal 1, other_sel.objects.count
|
|
190
|
+
end
|
|
191
|
+
|
|
169
192
|
test "full import process" do
|
|
170
193
|
Obj.create(apidae_id: 123, title: 'Objet à supprimer')
|
|
171
194
|
Obj.create(apidae_id: 4826186, title: 'Objet à mettre à jour')
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apidae
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jean-Baptiste Vilain
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -82,6 +82,7 @@ files:
|
|
|
82
82
|
- MIT-LICENSE
|
|
83
83
|
- README.rdoc
|
|
84
84
|
- Rakefile
|
|
85
|
+
- app/assets/config/manifest.js
|
|
85
86
|
- app/assets/images/apidae/logo-apidae-grey.svg
|
|
86
87
|
- app/assets/javascripts/apidae/application.js
|
|
87
88
|
- app/assets/stylesheets/apidae/application.css
|
|
@@ -209,6 +210,7 @@ files:
|
|
|
209
210
|
- test/data/hot_fr_en.json
|
|
210
211
|
- test/data/json_export.zip
|
|
211
212
|
- test/data/selections.json
|
|
213
|
+
- test/data/shared_selections.json
|
|
212
214
|
- test/data/structure.json
|
|
213
215
|
- test/data/update_selections.json
|
|
214
216
|
- test/dummy/README.rdoc
|
|
@@ -285,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
285
287
|
version: '0'
|
|
286
288
|
requirements: []
|
|
287
289
|
rubyforge_project:
|
|
288
|
-
rubygems_version: 2.6.
|
|
290
|
+
rubygems_version: 2.7.6.2
|
|
289
291
|
signing_key:
|
|
290
292
|
specification_version: 4
|
|
291
293
|
summary: A Ruby on Rails engine for projects that involve Apidae data
|
|
@@ -351,6 +353,7 @@ test_files:
|
|
|
351
353
|
- test/controllers/apidae/dashboard_controller_test.rb
|
|
352
354
|
- test/controllers/apidae/references_controller_test.rb
|
|
353
355
|
- test/controllers/apidae/import_controller_test.rb
|
|
356
|
+
- test/data/shared_selections.json
|
|
354
357
|
- test/data/equ_groups.json
|
|
355
358
|
- test/data/update_selections.json
|
|
356
359
|
- test/data/json_export.zip
|