aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2017-08-25HTTPService spec: Remove upload mock expectationsTeddy Wing
These relied on the previous behaviour of `#post_resource` handling uploads. This is no longer the case. Instead, you have to call `HTTPService.upload` manually and pass the result to `#post_resource` via the `params` argument (like in `WorkbenchImportWorker#params`).
2017-08-25NetexImportsController spec: Fix failing tests caused by KludgeTeddy Wing
The `ReferentialMetadataKludge` expects a couple of `Chouette::Line`s to already exist in the database in order to successfully create a `ReferentialMetadata` record. In tests, this is not the case. As a kludge to the kludge, create the expected line records in the tests that fail because of it, with the proviso that these additions should be removed or changed once we have real `ReferentialMetadata` handling for imports.
2017-08-25ErrorFormat: Change collection structureTeddy Wing
These tests were failing: 1) NetexImport POST netex_imports with correct credentials and incorrect request behaves like illegal attributes missing file does not succeed Failure/Error: expect( json_response_body['errors'][bad_attribute.to_s] ).not_to be_empty TypeError: no implicit conversion of String into Integer Shared Example Group: "illegal attributes" called from ./spec/requests/api/v1/netex_import_spec.rb:90 # ./spec/requests/api/v1/netex_import_spec.rb:77:in `[]' # ./spec/requests/api/v1/netex_import_spec.rb:77:in `block (6 levels) in <top (required)>' # -e:1:in `<main>' 2) NetexImport POST netex_imports with correct credentials and incorrect request name already taken behaves like illegal attributes missing name does not succeed Failure/Error: expect( json_response_body['errors'][bad_attribute.to_s] ).not_to be_empty TypeError: no implicit conversion of String into Integer Shared Example Group: "illegal attributes" called from ./spec/requests/api/v1/netex_import_spec.rb:96 # ./spec/requests/api/v1/netex_import_spec.rb:77:in `[]' # ./spec/requests/api/v1/netex_import_spec.rb:77:in `block (6 levels) in <top (required)>' # -e:1:in `<main>' The problem was caused by the fact that the error messages come back from `ErrorFormat` as an array of hashes, which contain a single key corresponding to the invalid field. Instead, the error messages should be returned as a single hash with a bunch of keys corresponding to the invalid fields. This change gets the above tests to pass.
2017-08-25NetexImportsController spec: Change name of referentialTeddy Wing
While `ReferentialMetadataKludge` exists, the name needs to match one of the keys in `#name_to_periods`, otherwise all the tests that use these attributes fail.
2017-08-25Merge branch 'master' into stagingXinhui
2017-08-25ErrorFormat: Tidy up whitespaceTeddy Wing
2017-08-25ErrorFormat spec: Use `build_stubbed`Teddy Wing
Speed up these tests by using `build_stubbed` for factories where possible.
2017-08-25Clean timetable dates after updating day typescedricnjanga
2017-08-25Temporarily skip WorkbenchImportWorker testsTeddy Wing
These tests broke because the ZipService changed. Since they seem to require a lot of modifications or rewrites in order to get them back in working order, skip them for now until I can revisit them next week.
2017-08-25Disable duplicate modal submit button on conditionscedricnjanga
2017-08-25Remove `controllers/support/error_format.rb`Teddy Wing
This one doesn't do anything. The real one currently lives in `app/models/concerns/error_format.rb` (it shouldn't live there according to Robert, but for now that's the story).
2017-08-25WorkbenchImportWorker spec: Change `#update_attributes` to `#update`Teddy Wing
Now that the code has been changed to use `#update`, update these test mocks to bind to the right method.
2017-08-25WorkbenchImportWorker spec: Remove use of `RetryService`Teddy Wing
The `RetryService` is not used any more, so this code that uses it should be removed.
2017-08-25Remove `RetryService`Teddy Wing
This is no longer being used as the `WorkbenchImportWorker` was refactored and it was decided that we don't want to enable retries for imports. For example, imagine you have an hour-long import that fails after 50 minutes. We retry three times and now we've wasted 2.5 hours of your time just to tell you that the import failed. Thus the decision was to remove it.
2017-08-25ReferentialMetadataKludge: Use non-overlapping dates in test dataTeddy Wing
Previously, the OFFRE_... zip's two referentials had overlapping dates (2017-03-01..2017-03-31 & 2017-03-01..2017-12-31). This caused this validation error when trying to save the referentials: OFFRE_TRANSDEV_20170301122517 couvre le même périmètre d'offre To fix this, Alban & I changed the dates of the two offers inside the zip (in the calendrier.xml files) and matched the dates in `ReferentialMetadataKludge`.
2017-08-25NetexImport: Run Java import API call in a threadTeddy Wing
While testing imports with Alban, we saw that this request was blocking, not asynchronous. The Java application apparently didn't figure that it should close HTTP connections before handling a long-running import job. In order to get around that on the Rails appliation side, Alban suggested putting the request in a thread. Works like a charm, and we respond in a sensible amount of time.
2017-08-25ReferentialMetadataKludge: Get line IDs by `objectid`Teddy Wing
Instead of hard-coding an ID for the line IDs, get them by their `objectid` field. Worked on this with Alban. Even though the Kludge class is for testing purposes only and isn't meant to be real, let's take out the hard-coded values. The `objectid`s correspond to those in the OFFRE_... zip in `spec/fixtures/`.
2017-08-25WorkbenchImportWorker#params: Remove unpermitted `referential_id`Teddy Wing
This param isn't permitted by the controller and we're currently not using it for anything. It produces a warning message in the logs, so I figured we should remove it. We may want to change the architecture to create referentials outside of the API, and thus would have to add this param in, but until then it's not needed.
2017-08-24Edit VJ to enable shift and to go past midnight (DayOffset)cedricnjanga
2017-08-24Unify npm options in ci rake task and capistrano. Remove --silent option to ↵Alban Peignier
display ... errors
2017-08-24Add --profile option to rspec during ci tasksAlban Peignier
2017-08-23Refs #4258: adding overhead feature to table_builder, with static samples on ↵jpl
imports#show
2017-08-23Refactoring spec api import#createXinhui
2017-08-23API - WorkbenchImport #create actionXinhui
Refs #4280
2017-08-23Limite actions on api imports routeXinhui
2017-08-23Model Import belong_to referential is no longer requiredXinhui
Refs #4280
2017-08-23Transferring code to Teddy; allowing him to do git push --force-with-leaseRobert
2017-08-22Refs: 4273@5h; Still debugging zip file upload inside post to Rails api; ↵Robert
Retry removed (but not the deadcode yet) [amend me]
2017-08-22API - workbench imports controllerXinhui
2017-08-22Rspec api iboo controllerXinhui
2017-08-22API - Refactoring iboo controller basic auth username should be an ↵Xinhui
organisation code
2017-08-22API - Rspec basic auth api controllerXinhui
2017-08-22API - new end point for workbenchesXinhui
2017-08-22API - Iboo controller for basic auth end pointsXinhui
2017-08-22Refs #4256: adding started_at filterjpl
2017-08-22Updating imports menu link (tests ok)jpl
2017-08-22Refs: #4273@3h;Robert
Debugging Java Integration (ZipService -> HTTPService -> Object Creation) - Created an ErrorFormat concern to see what went wrong in the HTTP call as so many things can go wrong due to: * Timeout Issues * Illegal database setup or cleaning before tests
2017-08-21Refs #4246 Fix combinaitions to only consider effective days for the two ttcedricnjanga
2017-08-21Revert "Updating imports menu link"Alban Peignier
This reverts commit 30b746b8b238c9ba22e972556e94950adb3f5e8b.
2017-08-21Refs: #4189@4h; Allowing change of `name` and `public_name` in ↵Robert
`Chouette::Route#duplicate`
2017-08-21Add the possibility to add included days in a periodcedricnjanga
2017-08-21Refs: #4273@20h; Reverse Engeneeiring RubyZip fixed ZipServiceRobert
- Replzed Lazy Enum over get_next_entry and group by with explicit looping and yielding to an instance level enumerator that yields streams per subdir (wich represents a referential). - Fixtures and Specs that use a REAL usecase. Next: Get rid of metadata kludge (should fix failing specs)
2017-08-18Fix model_name method fatten namespaceXinhui
2017-08-18Api_key policy classXinhui
2017-08-18Refactoring api_key#new form with simple_formXinhui
2017-08-18Refactoring api_keys views with table_builderXinhui
2017-08-18Updating imports menu linkjpl
2017-08-17Model ApiKey add belongs_to organisationXinhui
2017-08-17Refs #4257: Updating layout for imports#newjpl
2017-08-17Refs #4256: Adding creator attr. on imports#indexjpl