aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
AgeCommit message (Collapse)Author
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-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
2017-11-30Fixes: #5130@0.5h; Spec added, migration addedRobert
2017-11-28Add has_paper_trail on modelsXinhui
2017-11-27Refs #4941 Fix objectid short version Display on viewscedricnjanga
2017-11-27Merge branch '4941-refactoring_object_id'cedricnjanga
2017-11-27Refs #5030 Fix missing translation for UnactivatedStopPoint ComplianceControlcedricnjanga
2017-11-24Add specs for Objectid modelscedricnjanga
2017-11-24Remove specs we dont need anymorecedricnjanga
2017-11-24Take into account code reviewcedricnjanga
2017-11-23Add spec for stif_netex objectid_formatcedricnjanga
2017-11-22Add some changes to the objectid constructioncedricnjanga
2017-11-22Add Cédric new objectid concernscedricnjanga
objectid_support handles reading and writing object_ids objectid_formater_support gets the right formater class include these concerns in chouette models Remove StifNetexAttributSupport modules because these are handled by the new objectid concerns Add a objectid and formater classes for each format type Add objectid formats to the factories Modify somes specs for object_ids but there are still a number of failling tests
2017-11-22Merge branch 'master' into 4941-refactoring_object_idcedricnjanga
2017-11-22Merge branch 'master' into 4941-refactoring_object_idcedricnjanga
2017-11-20Change the use of namespace and remove modulescedricnjanga
2017-11-17Add some changes to the objectid constructioncedricnjanga
2017-11-17NetexImport: Don't destroy non-existent ReferentialsTeddy Wing
Luc discovered this error in my method that destroys associated non-ready `Referential`s: > WorkbenchImport.destroy_all WorkbenchImport Load (3.0ms) SELECT "public"."imports".* FROM "public"."imports" WHERE "public"."imports"."type" IN ('WorkbenchImport') (1.5ms) BEGIN ImportMessage Load (2.7ms) SELECT "public"."import_messages".* FROM "public"."import_messages" WHERE "public"."import_messages"."import_id" = $1 [["import_id", 58]] ImportResource Load (1.9ms) SELECT "public"."import_resources".* FROM "public"."import_resources" WHERE "public"."import_resources"."import_id" = $1 [["import_id", 58]] Import Load (0.3ms) SELECT "public"."imports".* FROM "public"."imports" WHERE "public"."imports"."parent_id" = $1 [["parent_id", 58]] ImportMessage Load (0.5ms) SELECT "public"."import_messages".* FROM "public"."import_messages" WHERE "public"."import_messages"."import_id" = $1 [["import_id", 59]] ImportResource Load (4.8ms) SELECT "public"."import_resources".* FROM "public"."import_resources" WHERE "public"."import_resources"."import_id" = $1 [["import_id", 59]] SQL (1.3ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 636]] SQL (0.3ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 635]] SQL (0.2ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 634]] SQL (0.2ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 633]] SQL (0.2ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 632]] SQL (0.2ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 631]] SQL (0.2ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 630]] SQL (0.1ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 629]] SQL (0.2ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 628]] SQL (0.1ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 627]] SQL (0.1ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 626]] SQL (0.3ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 625]] SQL (0.3ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 624]] SQL (0.2ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 623]] SQL (0.2ms) DELETE FROM "public"."import_resources" WHERE "public"."import_resources"."id" = $1 [["id", 622]] Import Load (0.3ms) SELECT "public"."imports".* FROM "public"."imports" WHERE "public"."imports"."parent_id" = $1 [["parent_id", 59]] Referential Load (0.6ms) SELECT "public"."referentials".* FROM "public"."referentials" WHERE "public"."referentials"."id" = $1 LIMIT 1 [["id", 18]] (0.2ms) ROLLBACK NoMethodError: undefined method `ready' for nil:NilClass from .../stif-boiv/app/models/netex_import.rb:20:in `destroy_non_ready_referential' Since `referential` is not a required attribute, it can be nil. That was causing this to break because I tried to destroy a `Referential` that doesn't exist. Check that there's an associated `Referential` before trying to destroy it. Refs #4991
2017-11-17Merge pull request #113 from af83/4823-compliance_check_showteddywing
4823 compliance check show
2017-11-17Refs: #4823@4h; Fixed Transport(Sub)mode validation bugRobert
2017-11-17Refs: #4283@16h;Robert
- Implements the view Missing: - Spex failing (xpath navigation inside the display blocks is still faulty) - Links to compliance_checks#show do not work (actually not this page's problem)
2017-11-17Refs: #4461@0.75h; Fixing netex_import after_create callback to ↵Robert
after_commit on: :create
2017-11-17Refs: #4461@1h; CodeReviewRobert
- using webmock instead of mocking Net::HTTP therefore removing the connascence between the spec and the HTTP lib used in the implementation, thank you Teddy
2017-11-17Fixes: #4461@2h; Specing and ImplementingRobert
2017-11-17Refs: #4461@1.5h; Repaired netex_import factory, adapted spec/models/import_specRobert
2017-11-17Merge branch '4516_cleanup_rule_parameter_set'Xinhui
2017-11-17Merge pull request #116 from ↵Luc Donnet
af83/4962-when-WorkbenchImport-is-deleted-also-delete-associated-Referential-if-ready-false 4962 when workbench import is deleted also delete associated referential if ready false
2017-11-16Add Cédric new objectid concernscedricnjanga
objectid_support handles reading and writing object_ids objectid_formater_support gets the right formater class include these concerns in chouette models Remove StifNetexAttributSupport modules because these are handled by the new objectid concerns Add a objectid and formater classes for each format type Add objectid formats to the factories Modify somes specs for object_ids but there are still a number of failling tests
2017-11-14Remove model rule_parameter_setXinhui
Refs #4516
2017-11-13NetexImport: Destroy referential on destroy if ready:falseTeddy Wing
If the `NetexImport`'s associated `Referential` has `ready: false`, when the `NetexImport` is destroyed, also destroy the `Referential`. This prevents a case where users get an invalid `Referential` as a result of an import, but because of the `ready: false`, it doesn't display on the website, so they can't see what the problem is. Refs #4962
2017-11-13ComplianceCheckSet#update_status: Return `true` if no update happenedTeddy Wing
Return `true` from this method by default. If the `#update` call fails, then it will return `false`, but in all other cases, we should return `true`. That way, when the `Api::V1::ComplianceCheckSetsController#validated` endpoint is called, it will respond with the `ComplianceCheckSet` object instead of: {"status":"error","messages":[]} with no error messages. Refs #4757
2017-11-13ComplianceCheckSet#update_status: Handle resources with "IGNORED" statusTeddy Wing
If any associated resources have the "IGNORED" status, this shouldn't affect the outcome of a "successful" status. Allow the `ComplianceCheckSet` to be "successful" even if some `Resource`s are "IGNORED". Refs #4757
2017-11-13ComplianceCheckSet#update_status: Return result of `#update`Teddy Wing
We should return the result of the `ActiveRecord` `#update` call, so that we can determine if there was an error saving the `ComplianceCheckSet` record. Refs #4757
2017-11-13Revert "ComplianceCheckSet#update_status: Should return a boolean"Teddy Wing
This reverts commit b7477e28f90c961079c7b12c4992071cbc11b2d6. This logic isn't right. We should return true/false based on the result of `update`, as in, whether the value was able to be updated, instead of on the contents of the status.
2017-11-13ComplianceCheckSet#update_status: Should return a booleanTeddy Wing
Ensure that `#update_status` always returns a boolean value. We'll be using this to determine whether the updated status was 'successful' or not. Hmmm. Wait. That's not right. We want to return true from the update, we don't care about the status. The error case should be when the `update` fails. Darn. Refs #4757
2017-11-13ComplianceCheckSet#update_status: Reverse test data orderTeddy Wing
Move the successful `ComplianceCheckResource`s to the end so that these tests fail if we don't wait until the end of a loop through the resoures before updating the status to 'successful'. Refs #4757
2017-11-13ComplianceCheckSet#update_status spec: Add failure status casesTeddy Wing
Add test cases for status update when `ComplianceCheckResource` are "ERROR" and "WARNING". If a single Resource is "ERROR" or "WARNING", then the `ComplianceCheckSet` becomes "failed" or "warning". Refs #4757
2017-11-13ComplianceCheckSet#update_status: Add spec for successful childrenTeddy Wing
Initial spec that checks the correct status field change when all `ComplianceCheckResource`s are successful. Refs #4757
2017-11-13Import: Destroy associated `Referential` on destroy if ready:falseTeddy Wing
If the `Import`'s associated `Referential` has `ready: false`, destroy that `Referential` when the import is destroyed. Aaand looking back at the task it turns out that's not what I was supposed to do. Right, it does seem a little weird in retrospect. Instead we want to delete the `Referential`s of child imports. Refs #4962
2017-11-10Add validation and specs to models on objectid_format presencecedricnjanga
2017-11-09Merge branch '4944_remove_route_section_code'Xinhui
2017-11-09Refs #4932 Change route duplication to redrect to routes#indexcedricnjanga
2017-11-09Remove model route_sectionsXinhui
2017-11-03Refs: #4802@0.15h;Robert
CR 2nd part - typos - unnecessary `class: Referential` removed from referentials_factory - regrouping of referential_suite related model specs
2017-11-03 Refs:#4802@0.5h;Robert
CodeReview: - Exchange fr and en translation files for referential_suites - Consistent usage of `jeu de donées` and `espace de travail` dans les *fr.yml Fixes: #4802@0.2h; Replaying former work. To identify spec regression Step 3: Added validation of reference_suite#new/current Made all specs pass
2017-11-02 Refs: #4802@2h; Replaying former work. To identify spec regressionRobert
Step 2: Added validation of reference->workbench->organisation consistency Made all specs pass Chased bug #4826