aboutsummaryrefslogtreecommitdiffstats
path: root/spec
AgeCommit message (Collapse)Author
2017-09-15Refs: #4446@0.3h; Integrated Policy Specs of #4442 and adapting them to the ↵Robert
needs of #4446
2017-09-15merged 4442 into 4446Robert
2017-09-14Refs: #4446@1h; Api Keys Edit feature specedRobert
2017-09-14Refs: #4446@0.7438h; Creation feature specedRobert
2017-09-14create base structure for compliance_control_setsGuillaume
2017-09-14ComplianceControl Controller4467_compliance_control_crudXinhui
Refs #4467
2017-09-14Refs: #4446@1h; Migration, using VPN for app, clarification of specs --> ↵Robert
Ticket in Feedback
2017-09-14Fixes: #4442@0.5h;4442-api_keys-permissions-spexRobert
2017-09-14Hotfix from masterRobert
2017-09-14Merge branch 'master' into stagingLuc Donnet
2017-09-14Fixes: #4431@0.16666666666666666h;4431-permission-renamingRobert
2017-09-14Merge branch 'master' of github.com:AF83/stif-boivLuc Donnet
2017-09-14Change wayback values in route Refs #3395 @4Luc Donnet
2017-09-14fix permission tests for newly introduced `api_keys.*` permissionsRobert
2017-09-13Uses match_array in permission_translatorspec. Refs #4019Alban Peignier
2017-09-13Change SimpleCov configuration to exclude some dummy directories. Refs #4474Alban Peignier
2017-09-12Merge branch 'master' into compliance_controlXinhui Xu
2017-09-12Merge pull request #63 from af83/4189-duplicate-routeLuc Donnet
4189 duplicate route
2017-09-12Change some specs to have all the wokbenches name to be 'Gestion de l'offre' ↵cedricnjanga
like in application controller
2017-09-12Refs: #4189@2h; Fixing logical merging issues, preparing PRRobert
2017-09-11merged with masterRobert
2017-09-11Fixes #4189@4h Route DuplicationRobert
* Duplication of Route is triggered by link and UI forwarded to edit of duplicatee - Changing route, only POST duplicate_referential_line_route --> RoutesController#duplicate - Removing route GET duplicate_referential_line_route --> RoutesController#duplicate - Removing controller action RoutesController#post_duplicate * Link in Route Decorator depends on new policy RoutePolicy#decorate? * Adapting specs
2017-09-11Update of ReferentialsController#new :cedricnjanga
- Add some context to referential and workbench decorator to access current_referential and assign it to the cloned referential - Add a build_referential method to avoir duplicates of code (in the controller and in the model), need to clean a bit more - Need to add some Spec features to take into account the functional scope of the current_user
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-07Merge branch 'master' into stagingLuc Donnet
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-06Merge branch 'master' into stagingLuc Donnet
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-05Merge pull request #61 from af83/workbenchimportworker--reinstate-teststeddywing
Workbenchimportworker reinstate tests
2017-09-05Model ComplianceCheckBlockXinhui
Refs #4387
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-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-04Merge branch 'master' into stagingLuc 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`.
2017-09-04Delete AAM in import_resource model Refs #4527Luc Donnet