aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-09-11ImportMessage: Remove `dependent: :destroy` on :resource associationTeddy Wing
It doesn't really make sense to have a `dependent: :destroy` here. For one thing, the `Import` class has the necessary `dependent: :destroy` definitions to remove its associated objects when it gets deleted. At this point, according to Luc, we don't envision deleting `ImportResource`s separately from `Import`s. The other weird thing is that: * `ImportResource` has many `ImportMessage`s * `ImportMessage` has one `ImportResource` With the `dependent: :destroy` set up the way it is here on `ImportMessage`, we could potentially be deleting an `ImportResource` with other `ImportMessage` children that would then become orphaned. For both these reasons, it seems better to remove this trigger. Refs #4412
2017-09-11Import specs: Add tests to verify dependent-destroy of associationsTeddy Wing
When an import is destroyed, all: * child imports * associated `ImportReference`s * associated `ImportMessage`s must be destroyed. This is handled by a `dependent: :destory` on the associations. Here we add tests to validate that the records get properly destroyed. Refs #4412
2017-09-11Fix spec error formatLuc Donnet
2017-09-08Disable uniqueness of name for referential because it stops import for same ↵Luc Donnet
referential Refs #4415 @1
2017-09-07Merge branch 'master' into stagingLuc Donnet
2017-09-07Merge branch 'master' of github.com:AF83/stif-boivLuc Donnet
2017-09-07Fix import messages locales key in java process Refs #4370 @1Luc Donnet
2017-09-07Restore Referential#clone_schema invocation. Refs #4335Alban Peignier
2017-09-07Avoid Appartment schema creation when cloning is pending. Add a spec which ↵Alban Peignier
performs a real referential clone. Refs #4335
2017-09-07Set default value for data_source_refXinhui
Refs #4406
2017-09-07Reflex:sync log invalid objectXinhui
Refs #4367
2017-09-07Add data_source_ref for model Route, JourneyPattern, RoutingConstraintZone, ↵Xinhui
VehicleJourney, Timetable, Footnote Refs #4368
2017-09-07Update links in nav leftLuc Donnet
2017-09-06Add Organisation column in Calendars#index Tablecedricnjanga
2017-09-06Fix autocomplete issues on Timetable Select2cedricnjanga
2017-09-06Merge branch 'master' into stagingLuc Donnet
2017-09-06Merge branch 'master' of github.com:af83/stif-boivcedricnjanga
2017-09-06Fix import messages when referential can't be created. Delete unused sass ↵Luc Donnet
files. Refs #4259
2017-09-06Change humanOID function to take into account objectid changescedricnjanga
2017-09-06Model ComplianceCheckResultXinhui
Refs #4390
2017-09-06Model ComplianceCheckResourceXinhui
Refs #4391
2017-09-06Resolve merge conflictcedricnjanga
2017-09-06Model ComplianceCheckXinhui
Refs #4388
2017-09-06Merge branch 'master' of github.com:AF83/stif-boivLuc Donnet
2017-09-06Fix import messages export to csv Refs #4259Luc Donnet
2017-09-06Updated imports#index date filter : used the same logic for the ↵cedricnjanga
Calendar#index date filter (ransackable scope) I realized that we could submit the form with incomplete date which caused an 500 error. So I added a small JS script to prevent user from subnitting filter form with incomplete dates Since it was really similar with previous work I added two folders : /helpers & /filters to be more DRY The JS files are loaded in 4 views for the moment, hence the update in the assets.rb file
2017-09-06Merge branch 'master' of github.com:AF83/stif-boivLuc Donnet
2017-09-06Comment call for deleted class ReportConcernLuc Donnet
2017-09-05Merge pull request #61 from af83/workbenchimportworker--reinstate-teststeddywing
Workbenchimportworker reinstate tests
2017-09-05Model ComplianceCheckBlockXinhui
Refs #4387
2017-09-05Merge branch 'master' of github.com:AF83/stif-boivLuc Donnet
2017-09-05Comment call for deleted class ReportConcernLuc Donnet
2017-09-05Model ComplianceCheckSetXinhui
Refs #4386
2017-09-05Model ComplianceControlXinhui
Refs #4385
2017-09-05Remove typocedricnjanga
2017-09-05WorkbenchImportWorker spec: Check `ended_at` update after importTeddy Wing
The import job now updates its `ended_at` time at the end of the import job. The mock didn't know this, though, so it gave us an error at that call. Add a new expectation for the update of the `ended_at` time to get this test to pass again.
2017-09-05Skip temporarily some testscedricnjanga
2017-09-05Refs #4322cedricnjanga
2017-09-05Referential#new_from :cedricnjanga
Added params to certains paths to have the workbench_id in it. The goal is to have the current workbench_id to assign it when do a Referential#new_from Then I finished the use of the functional scope to avoid potential errors I skipped some tests that hve a #TODO so we can easily find them
2017-09-05Model ComplianceControlBlockXinhui
Refs #4384
2017-09-05WorkbenchImportWorker spec: Catch `StopIteration` exceptionTeddy Wing
The code was changed in 038710b22ccf3dd2421ec8d07fae45ef05a47ada, but the tests weren't changed to reflect this. In that change, the subdir enumeration is stopped if the `HTTPService` POST request fails with an error. This caused us to receive the following error when running the tests: 2) WorkbenchImportWorker multireferential zipfile with error downloads a zip file, cuts it, and uploads some pieces Failure/Error: expect { worker.perform import.id }.to raise_error( StopIteration, post_response_failure.body ) expected StopIteration with {:error=>"What was you thinking"}, got #<StopIteration: {:error=>"What was you thinking"}> with backtrace: # ./app/workers/workbench_import_worker.rb:63:in `upload_entry_group' # ./app/workers/workbench_import_worker.rb:38:in `each' # ./app/workers/workbench_import_worker.rb:38:in `each_with_index' # ./app/workers/workbench_import_worker.rb:38:in `upload' # ./app/workers/workbench_import_worker.rb:15:in `perform' # ./spec/workers/workbench_import_worker_spec.rb:105:in `block (4 levels) in <top (required)>' # ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in <top (required)>' # -e:1:in `<main>' # ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in <top (required)>' # -e:1:in `<main>' In order to get around this, just catch the error. Hopefully this is right.
2017-09-05WorkbenchImportWorker spec: Mock upload paramsTeddy Wing
Was getting this error as a result of the new parameters expected in `mock_post`: 2) WorkbenchImportWorker multireferential zipfile with error downloads a zip file, cuts it, and uploads some pieces Failure/Error: HTTPService.post_resource( host: export_host, path: export_path, params: params(eg_file, eg_name)) HTTPService received :post_resource with unexpected arguments expected: ({:host=>"http://www.example.com", :path=>"/api/v1/netex_imports.json", :params=>{:netex_import=>{:par... @original_filename="subdir 0.zip", @local_path="local.path", @io=#<Double "subdir 0">, @opts={}>}}}) got: ({:host=>"http://www.example.com", :path=>"/api/v1/netex_imports.json", :params=>{:netex_import=>{:par.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip>, @opts={}>}}}) Diff: @@ -7,5 +7,5 @@ :workbench_id=>1019, :name=>"subdir 0", :file=> - #<UploadIO:0x007f9bd144dbe8 @content_type="application/zip", @original_filename="subdir 0.zip", @local_path="local.path", @io=#<Double "subdir 0">, @opts={}>}}}] + #<UploadIO:0x007f9bd14a1450 @content_type="application/zip", @original_filename="subdir 0.zip", @local_path="/.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip", @io=#<File:/.../stif-boiv/tmp/imports/WorkbenchImport_subdir 0_38821.zip>, @opts={}>}}}] # ./app/workers/workbench_import_worker.rb:29:in `execute_post' # ./app/workers/workbench_import_worker.rb:59:in `upload_entry_group' # ./app/workers/workbench_import_worker.rb:38:in `each' # ./app/workers/workbench_import_worker.rb:38:in `each_with_index' # ./app/workers/workbench_import_worker.rb:38:in `upload' # ./app/workers/workbench_import_worker.rb:15:in `perform' # ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in <top (required)>' # -e:1:in `<main>' To get around this, decided to just mock the `HTTPService#upload` method because I don't really care about these attributes.
2017-09-05WorkbenchImportWorker spec: Use `subdirs` in place of `entry_groups`Teddy Wing
Since the concept of `entry_groups` was changed to `subdirs`, this change needs to be reflected in the tests. Instead of looping over `entry_groups`, we now loop over `subdirs`, and pass this object directly to `mock_post`. The `mock_post` helper is now rewritten to reflect the new structure of post parameters. Remove the `params` `let` because it's not used anywhere else and we need to pass the arguments to `mock_post` into it. This currently errors because `Faraday::UploadIO` isn't passed the parameters that are expected in `mock_post`.
2017-09-05Model ComplianceControlSetXinhui
Refs #4383
2017-09-05Clean up compliance checks existing code Refs #4389 @1Luc Donnet
2017-09-05Merge branch 'master' into stagingLuc Donnet
2017-09-05Delete call to pry in referential destroyLuc Donnet
2017-09-04Merge branch 'master' into stagingLuc Donnet
2017-09-04Fix import status table views and first version for import_messages Refs #4527Luc Donnet
2017-09-04WorkbenchImportWorker spec: Change `entry_group_streams` to `subdirs`Teddy Wing
This changed in the new `ZipService`. We're now using a `Subdir` object, we we need to use that in the tests instead of the `entry_group_streams`.