aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
AgeCommit message (Collapse)Author
2018-01-05Merge VehicleJourneys and VehicleJourneyAtStops. Refs #5299Alban Peignier
2018-01-05Merge Route and their StopPoints in the same operation to create Route with ↵Alban Peignier
same checksums. Refs #5299
2018-01-05First try for route/stop_point and journey_pattern merge. Refs #5299Alban Peignier
2018-01-05Rewrite metadata merge (still partial). Refs #5299Alban Peignier
2018-01-05Ignore detect_overlapped_referentials when Referential is into a ↵Alban Peignier
ReferentialSuite. Refs #5299
2018-01-05Create Merge operation. Refs #5299Alban Peignier
2018-01-03Merge branch 'master' into ↵Luc Donnet
5024-prevent-duplicate-referentials-from-being-created-during-parallel-db-transactions--rb201711271659
2018-01-02Merge pull request #191 from af83/5436-keep-stops-order-on-routes-cloningAlban Peignier
Add specs on Route#duplicate to ensure the stops order is preserved. Refs #5436
2017-12-29Validates import file extension with CarrierWave extension_whitelist. Refs #4762Alban Peignier
2017-12-29Refs #5415 fix ComplianceControl#show for controls which dont have dynamic ↵cedricnjanga
attributes
2017-12-28Fix spec AccessPoint invalid stop_area parentXinhui
Refs #5313
2017-12-28Merge pull request #184 from af83/5313_stop_areas_parentAlban Peignier
Manage stop area parent in form and show. Refs #5313
2017-12-28Add specs on StopArea parent area_type validation. Refuse parent of the same ↵5313_stop_areas_parentAlban Peignier
type. Refs #5313
2017-12-28Refs #5436; Add specs on Route#duplicate to ensure the stops order is preserved5436-keep-stops-order-on-routes-cloningZog
2017-12-28Refs #5407; Fix data not being updated in the DBZog
2017-12-28Include purchase_windows in vehicle_journey state into specs. Refs #5407Alban Peignier
2017-12-27Refs #5407 @2h; Model implementationZog
- Link PurchaseWindows to VehicleJourneys in the model - Add an autocompletion endpoint
2017-12-26Don't use i18n into Chouette::AreaType specs. Refs #5311Alban Peignier
2017-12-26Enable GDL in StopArea enumeration. Refs #5311Alban Peignier
2017-12-21Merge branch 'master' into ↵Luc Donnet
5316-migrate-compliance-control-and-check-attributes-from-hs
2017-12-21Remove `hstore_accessor` usageTeddy Wing
The places we were using `hstore_accessor` have now been converted to Postgres JSON fields. Thus we no longer need `hstore_accessor` in order to add accessors for the fields. Instead we can use Rails' built-in support for Postgres JSON fields and create accessors for our JSON hash keys with `store_accessor`. We get rid of the data types because `store_accessor` doesn't work like that and JSON already types our values with primitive data types. Finally, add some extra validation tests now that the vaildation for our JSON fields should work. Refs #5316
2017-12-21Merge pull request #150 from af83/5301-add_business_calendarsLuc Donnet
Refs #5301 First draft for Business Calendars
2017-12-21BusinessCalendar => PurchaseWindowcedricnjanga
belongs_to referential
2017-12-21Refs #5301 First draft for Business Calendarscedricnjanga
2017-12-20Add StopArea#waiting_time with support in stop_areas#index/show. Refs #5351Alban Peignier
2017-12-20Fixes Organisation#has_feature? spec title. Refs #5339Alban Peignier
2017-12-20Create Organisation#features and FeatureChecker controller concerns. Refs #5339Alban Peignier
2017-12-20Merge pull request #124 from af83/5006-wb_import_filter_refs_with_foreign_linesLuc Donnet
5006 wb import filter refs with foreign lines
2017-12-19Refs: #5311@0.1h; Minor CR changes5311-stop-area-type-customizableRobert
2017-12-18Clear Chouette::AreaType caches during specs. Refs #5311Alban Peignier
2017-12-18Add first specs on Chouette::AreaType. Refs #5311Alban Peignier
2017-12-18Merge pull request #146 from af83/5283-refactor-referential-cloning-workerteddywing
#5283 - Simplifier ReferentialCloningWorker
2017-12-18Remove unless subject alias_method. Use be_nil when possible. Refs #5283Alban Peignier
2017-12-14Refs: #5006@3h;Robert
Working out how to check for allowed lines vs. foreign lines - Implement allowed_lines as `Organisation#lines_set` - Pushed line_id related stuff into `lib/stif/codif_line_id.rb` - Related Specs
2017-12-14Fixes ways to create lines in Workbench specAlban Peignier
2017-12-13referential_lock_during_creation_spec: Skip truncation testsTeddy Wing
Just discussed this with Alban. The truncation tests are breaking the test suite, and I've spent way too long on this already. Take the specs out of the suite for now until we can come up with a different way to run these or test this behaviour without breaking everything. The new task to fix this is #5295. Refs #5024
2017-12-13referential_lock_during_creation_spec: Make truncation strategy stickTeddy Wing
The `truncation: true` strategy wasn't sticking. The config `before` block only ran once for this test file. Instead of attaching the filter to the `it` blocks, put it on the `context`. This correctly gets each test to run in a transaction. Remove the `truncation: false` filter I had added previously as this didn't do what I wanted it to: it prevented the `before` block from running instead of filtering out tests with `truncation: true`. Refs #5024
2017-12-13referential_lock_during_creation_spec: Extract method for threadsJohan Van Ryseghem
Refactor these tests to abstract the thread & transaction creation & handling. Thread creation and joining can now live in one place apart from the tests, and the tests have an interface to set up concurrent referential saving. Thanks to Johan for this refactor. Refs #5024
2017-12-12Move logic to ReferentialCloning. Improve specs. Refs #5283Alban Peignier
2017-12-12referential_lock_during_creation_spec: Don't create unnecessary RefTeddy Wing
The `referential_metadata` factory will create an associated referential by default. This causes errors in our tests because we haven't cleaned up the trailing referential. Refs #5024
2017-12-12Referential: Lock table on :updateTeddy Wing
We had been locking the `referentials` table on :create, but we also want to handle :update. Paired on this with Johan. When I used: referential_2.metadatas << metadata_2 the referential was saved. To add the metadata without automatically saving the referential + metadata, Johan suggested using the nested attribute method: referential_2.metadatas_attributes = [metadata_2.attributes] This allows us to add the metadata and still use the `#save` method to lock the table. Also change the callback from `before_validation` to `before_save` because before_validation :lock_table, on: [:create, :update] didn't work. That caused an error in our `expect`, as the `be_valid` triggered the lock callback. To enable the callback on both :create and :update, use a `before_save` instead. Refs #5024
2017-12-12Referential: Raise an error if the table lock times outTeddy Wing
Paired with Johan on this one. There's an internal timeout on our table lock. If it's reached, an `ActiveRecord::StatementInvalid<PG::LockNotAvailable>` error is raised. Use a custom error instead by "overriding" `#save` with a method that raises our custom error in that case instead. This will enable us to provide a custom user-facing error in the event this happens. Refs #5024
2017-12-11Hotfix (Refs: #5209) Skip randomly failing specRobert
2017-12-07Fix worbench_import status update when a netex_import has a warning status ↵Luc Donnet
and others successful Refs #5202
2017-12-06referential_lock spec: Don't create unnecessary referentialTeddy Wing
The factory for `referential_metadata` was creating an unnecessary `Referential` object since it has an association set up. This was causing the test to fail because that referential's schema wasn't getting cleaned in the `ensure` block. Don't create that referential to avoid the error. Refs #5024
2017-12-05Merge remote-tracking branch 'origin/master' into ↵Teddy Wing
5024-prevent-duplicate-referentials-from-being-created-during-parallel-db-transactions--rb201711271659 Conflicts: app/models/referential.rb A whitespace conflict in a place I don't even remember editing? Okaay.
2017-12-05Fixes: #5179@1h; Referential Creation Enforces objectid_format from ↵5179-ref_creation_enforces_objectid_formatRobert
associated Workbench - CR changes implemented
2017-12-05Refs: #5179@0.25h; Referential Creation Enforces objectid_format from ↵Robert
associated Workbench - Removed obsolete spec
2017-12-05Refs: #5179@1.25h; Referential Creation Enforces objectid_format from ↵Robert
associated Workbench - changed ObjectIdFormatterSupport as requested - respeced all defined cases - implemented respec Missing: What to do in `define_default_attributes` if ref has no workbench and no `objectid_format`?
2017-12-05Refs: #5179@1h; Referential Creation Enforces objectid_format from ↵Robert
associated Workbench [skip-ci] - speced the `define_default_attributes` part - speced the Reference.new_from part