aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/chouette
AgeCommit message (Collapse)Author
2018-06-01Refs #7260; Fix wrong day offset computation7260-fix-time-interpolationZog
2018-05-30Refs #6433; Fix specsZog
2018-05-29Fix StopPoint#stop_area_lightZog
2018-05-17Refs #6624; Update parent's checksum on deletionZog
2018-04-30Fix VehicleJourney#fill_passing_times!Zog
2018-04-29Fix more specsZog
2018-04-27Fix Vehicle journeys specsZog
2018-04-27Disable 'compute passing time' specAlban Peignier
2018-04-26Refs #6826; Fix times interpolation with day offsets6826-fix-times-interpolationZog
2018-04-25Update VehicleJourney checksum when StopPoint change isn't necessary in fact ↵6711-update-parents-checksumAlban Peignier
(#mybad). Refs #6711
2018-04-25Refs #6711; Update checksums on parentsZog
When a StopPoint is updated
2018-04-22Fixes JourneyPattern specs (by adding position in JourneyPattern state). ↵Alban Peignier
Refs #6193
2018-04-22Fixes JourneyPattern specs with distance is not defined/zero. Refs #6413Alban Peignier
2018-04-19Refs #5519; Authorize 1-day calendarsZog
2018-04-19Merge pull request #488 from af83/6477-use-custom-fields-in-checksumsAlban Peignier
Use custom fields values in checksum calculation. Refs #6477
2018-04-16Refs #6477; Use custom fields values in checksum calculation6477-use-custom-fields-in-checksumsZog
2018-04-16Route: Don't run `#calculate_costs!` during a referential merge6410-route--don,t-run-calculate_costs-during-referential-merTeddy Wing
This callback got triggered during a referential merge, but it isn't needed at that point. It should only be executed as a result of a user updating the route (via the web interface). Using Alban's suggestion, we can detect that we're in the process of a merge if the associated referential is in a `ReferentialSuite`. Use this as a condition to run the callback. Refs #6410
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