aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/chouette
AgeCommit message (Collapse)Author
2018-04-16Route: Change `#calculate_costs!` to `after_commit` callbackTeddy Wing
Use an `after_commit` instead of an `after_save`. The `after_save` could cause intermittent problems due to Sidekiq starting before the record/transaction actually gets committed to the database. In those cases, the record wouldn't be found and cause an error. With an `after_commit` callback, the record is sure to be committed before Sidekiq takes over. Additionally, limit the callback to `:create` and `:update` because otherwise it will be active on `:destroy` by default also. This work isn't relevant on destroy, so don't do it then. Update the tests: * Update labels * Use `build` instead of `create` because we're saving the record at the end anyway so we don't need an object that starts out persisted * Use `truncation: true` for these tests because otherwise the `commit` callback doesn't get called due to transactional teardown Refs #6407
2018-04-11Specs cleanupZog
2018-04-09Refs #6367; Add metadata to other versioned modelsZog
2018-04-09Refs #6367; Add metadata to routesZog
2018-04-05Merge pull request #412 from af83/6217-extrapolate-border-passing-timesLuc Donnet
6217 Add a method to fill blanks in journeys passing times
2018-04-04Delete unused spec because we add a parameter to the function duplicate Refs ↵Luc Donnet
#6226
2018-04-04Fix specsZog
2018-03-29Refs #6075 Change default attributes for stop areascedricnjanga
2018-03-29Refs #6075 Replace after_commit callback to after_create for the ↵cedricnjanga
set_defaults method
2018-03-29Refs #6075 Set defaults attributes for stop point depending on stop area kindcedricnjanga
2018-03-26Refs #6217; Add a method to fill blanks in journeys passing timesZog
When a passing time at a border can be extrapolated from other values.
2018-03-15Route: Don't run `#calculate_costs!` on callback if TomTom disabledTeddy Wing
We say `TomTom` is disabled when no API key is present. If this is the case, the `after_save` callback that uses it shouldn't be executed. I had to change my `API_KEY` constant to an instance variable to be able to change it for testing. Refs #6095
2018-03-14Refs #6021: Make DAY_OFFSET_MAX configurableZog
2018-03-14Refs #6021 @1h; Allow journeys to span over 3 daysZog
And fix the way offsets are computed to use the timezones
2018-03-14Refs #5972 @1h; Automatic registration_number generationZog
2018-03-05Merge pull request #359 from af83/6068-simple-exporterAlban Peignier
Simple exporter. Refs #6068
2018-03-05Refs #6068; Add some helpers in the modelsZog
2018-02-26Fix specsZog
2018-02-20Fix specs on VehicleJourneyAtStopZog
2018-02-20Refs #5924 @2h; Provide a mechanism to define a custom importerZog
2018-02-09route_base_spec.rb: Fix checksum test as a result of factoryTeddy Wing
* The factory already creates `StopPoint`s for us, so we don't need to create any additional ones in the test. Previously this would give us eight stop points instead of three or five. * Update the checksum in the factory after generating stop points. We need to do this because otherwise the checksum will be incorrect, not taking into account the new stop points. Without this change, the checksum starts out in an inconsistent state and causes the: 1) Chouette::Route checksum behaves like checksum support doesn't change the checksum on save if the source hasn't been changed Failure/Error: expect(subject.checksum).to eq(checksum) expected: "bc0e7b37243682904bd7013108258fdc744b03e0c59ed1a30e24e112a49242c1" got: "b39d643fdd4f9d6ff62547750508af728a187de29a3d6e4295f9bb3d13559a51" (compared using ==) Shared Example Group: "checksum support" called from ./spec/models/chouette/route/route_base_spec.rb:5 # ./spec/support/checksum_support.rb:84:in `block (2 levels) in <top (required)>' test to fail. Refs #5416
2018-02-08Refactoring spec checksum support5416_checksum_attribute--rb201802071702Xinhui
Refs #5416
2018-02-07Refactoring use subject as factoryXinhui
Refs #5416
2018-02-07Edit checksum stop_points attributes for routeXinhui
Refs #5416
2018-02-06Fix checksum-related specsZog
2018-02-06Merge pull request #280 from af83/5417-checksum-relationshipsLuc Donnet
5417 Update parents checksum when children are created or updated
2018-02-02Refs #5417; Fix specs5417-checksum-relationshipsZog
2018-02-02Refs #5417; Update parents checksum when children are created or updatedZog
2018-02-02Refs 5832; Fix bug on ReferentialVehicleJourneys#index filtersZog
By default a value was always set on the "Line" filter, yielding misleading results.
2018-01-31Refs #5682; Add application_days field to calendarsZog
2018-01-31Fix specsZog
2018-01-31Merge pull request #264 from af83/5754-filter-journeys-on-calendarLuc Donnet
5754 Add a filter on purchase_windows on ReferentialVJs#index
2018-01-31Merge pull request #269 from ↵Luc Donnet
af83/5574-vehicle-journeys--fix-transporter-deletion-in-modal--rb 5574 vehicle journeys fix transporter deletion in modal rb
2018-01-31Refs #5754; Add a filter on calendars for ReferentialVJs#index5754-filter-journeys-on-calendarZog
2018-01-31Refs #5754; Add a filter on purchase_windows on ReferentialVJs#indexZog
2018-01-30VehicleJourney: Allow deletion of associated companyTeddy Wing
If the state doesn't contain a company, that means it was deleted on the frontend. In that case, the backend code should correctly delete the associated company from the vehicle journey. Refs #5574
2018-01-29Refs #5750 @1h; Manage non-commercial StopAreasZog
- Add a `kind` attribute - Hide irrelevant fields in the form
2018-01-26Refs #5750 @1h; Add a "kind" attribute to StopAreasZog
This determines if the StopArea is commercial or not The useless fields are hidden in the form for the non-commercials ones
2018-01-19Add missing spec on VehicleJourneyAtStopZog
2018-01-11Merge pull request #227 from af83/5551-handle-custom-fields-in-vjs-editorLuc Donnet
5551 Handle custom fields in VJs editor
2018-01-11Refs #5493 @1h; Use local time in the Journeys editorZog
We store UTC times in the database though
2018-01-11Merge pull request #226 from af83/5547-show-vj-idLuc Donnet
5547 Show newly created VJ's short_id in editor
2018-01-11Fixes Chouette::RoutingConstraintZone#route_id presence spec. Refs #5552Alban Peignier
2018-01-11Refs #5551 @1.5h; Implement Custom fields editionZog
RBD: implement the same in the creation modal
2018-01-11Refs #5547 @0.25h; Show newly created VJ's short_id in editorZog
2018-01-11Merge pull request #225 from af83/5535-compute-vehicle-journeys-timesLuc Donnet
5535 compute vehicle journeys times
2018-01-10Refs: #5505@1h; Small things found in s/models/chouette/vj_spec during ↵Robert
investigation of failures
2018-01-10Refs #5535 @0.25h; Adds a `full_schedule?` on `JourneyPattern`Zog
To know if all the costs between the stops of the pattern are set.
2018-01-10Use AreaType.label in StopArea parent type validation message. Refs #5515Alban Peignier
2018-01-08Refs #5455 @6h; Add time and distance between stops in Journey PatternsZog
- Adds a `JSON` attribute in the model - Adds the fields in the editor