aboutsummaryrefslogtreecommitdiffstats
path: root/spec
AgeCommit message (Collapse)Author
2017-09-27Refs #4615 Resolve rebase conflictcedricnjanga
2017-09-27Refs #4615 Change spec and controller regarding to the ComplianceControl ↵cedricnjanga
models changes
2017-09-27Refactoring controller spec - add compliance controle type supportXinhui
2017-09-27Add dependent destroy on associationsXinhui
2017-09-27Remove compliance control block id column from compliance_controls tableXinhui
Refs #4585
2017-09-27Move ComplianceControl#index into ComplianceControlSet#showXinhui
Refs #4579
2017-09-27Merge pull request #78 from ↵Robert Dober
af83/3520-workbench--add-output-association-to-ReferentialSuite 3520 workbench add output association to referential suite
2017-09-27spec/support/referential.rb: Use factoriesTeddy Wing
Instead of creating the objects directly in ActiveRecord, use our existing factories for these records as suggested by Robert. Refs #3520
2017-09-27Workbench spec: Use factoriesTeddy Wing
Leverage our existing factories instead of creating the objects on the models directly. Refs #3520
2017-09-26Specs fixed (from logical merge errors)Robert
2017-09-26Fixes: #4440@0.5h;Robert
Added Controller Spec Fixed Older Specs
2017-09-26Refs: #4440@1.5h;Robert
ImportPolicy changing *.imports →' imports.*
2017-09-26Refs: #4440@0.5h Added import permissionRobert
2017-09-26show compliance_control_set in compliance_check_set table, fix ↵Guillaume
compliance_check_set spec
2017-09-26Merge branch 'master' into stagingcedricnjanga
2017-09-25add compliance_check_sets structure Refs #3564Guillaume
2017-09-25spec/support/referential.rb: Remove `output` initialisationTeddy Wing
Since the `output` attribute is now initialised automatically in the `Workbench#initialize_output` `before_validation` callback, the one I added here before I created the callback can be removed. Instead we'll rely on the callback to create a new `ReferentialSuite` for us. Refs #3520
2017-09-25Workbench: Ensure `output` attr is initialised when creating workbenchTeddy Wing
Since all `Workbench`es must have an associated `ReferentialSuite` via `output`, if none is provided when creating a new `Workbench`, create one automatically. This is done in a `before_validation` callback (eck, AR callbacks). In order for our prior 'should validate_presence_of' test to continue to work, we have to work around the new callback, otherwise Shoulda can't set `output` to `nil` to run its expectation and the test fails. Refs #3520
2017-09-25Workbench: Validate presence of `output`Teddy Wing
Ensure all workbenches always have an associated `ReferentialSuite` by validating presence of the `output` attribute. In order to pass the 'should have a valid factory' test, we need to define a `ReferentialSuite` factory and set up a default association on `output` in the `Workbench` factory. We also need to add set `output` when creating a `Workbench` in `spec/support/referential.rb`, otherwise we get a validation error that breaks the tests. Clean up the formatting of that call. In order to pass a `ReferentialSuite`, I just create one above, but I'm not sure if I should be using a `find_or_create` mechanism like the other associated objects do above. Refs #3520
2017-09-25Workbench: Add `output` associationTeddy Wing
The `output` attribute should be a `ReferentialSuite`. Refs #3520
2017-09-25ModelAttribute spec: Move `#instance_variable_set` to `before` block4401-compliance-control-ModelAttribute--address-Robert,s-commentsTeddy Wing
Recommendation from Robert. The `@__all__` is an implementation detail. It's more fragile to use `#instance_variable_set` in each test. Instead, put that part in a `before` block so that if we decide to change it, we only have to do so in one place. Now each test can blithely assume that `ModelAttribute.all` starts out as an empty list. Refs #4401
2017-09-22Add `has_many` association between `Referential` and `ReferentialSuite`Teddy Wing
`ReferentialSuite` has many `Referential`s. Need to add a foreign key column to the `referentials` table to allow that to work. Refs #3519
2017-09-22Add `ReferentialSuite`Teddy Wing
This model is responsible for collecting referentials in order to merge them into a single referential. * `new` corresponds to a referential in the process of being validated * `current` corresponds to the most recently validated referential Refs #3519
2017-09-22Merge branch 'master' into stagingcedricnjanga
2017-09-22Merge pull request #75 from ↵teddywing
af83/4401-create-compliance-control-model-attribute-class 4401 create compliance control model attribute class
2017-09-22ModelAttribute: Add `#from_code` methodTeddy Wing
Enables finding a `ModelAttribute` by a string code combining klass and name. Refs #4401
2017-09-22ModelAttribute: Add `.group_by_class` methodTeddy Wing
This returns all defined `ModelAttribute`s as a hash of class keys containing lists of the attributes they contain. Refs #4401
2017-09-22ModelAttribute: Add `.classes` methodTeddy Wing
This allows people to get a list of the classes defined in `ModelAttribute`. The classes are turned into constant-cased strings. Not sure if that's useful, but this is how it was described in the ticket. Refs #4401
2017-09-22ModelAttribute: Add `.methods_by_class_and_type` methodTeddy Wing
This enables filtering by class like `.methods_by_class` and additionally only selecting attributes matching a certain data type. Refs #4401
2017-09-22ModelAttribute spec: Rename `@@all`Teddy Wing
In c9a997f337c9b45f62b50629de96fa95f20c1a7f, we changed the storage mechanism of `all` and made it not a class method. Update the spec description to reflect this. Refs #4401
2017-09-21Merge branch 'master' into stagingcedricnjanga
2017-09-21Fix test on vehicle journey at stopcedricnjanga
2017-09-21Merge branch 'master' into stagingcedricnjanga
2017-09-20Merge branch 'master' into Add_included_days_in_periodscedricnjanga
2017-09-20Merge master to branch and resolve all the conflictscedricnjanga
We also needed to take remove the right time table dates when we update day types : - excluded dates that are out of day types - included dates that are in day types and in periods
2017-09-19ModelAttribute.methods_by_class: Take symbol parameter instead of stringTeddy Wing
Didn't like how `#initialize` takes a different type for `klass` than `.methods_by_class`. Make these types and values uniform. If we need to change it, we should make a separate mechanism to do so. I think. Refs #4401
2017-09-19ModelAttribute: Add `.methods_by_class` methodTeddy Wing
Allows us to get all `ModelAttribute`s given a certain class name. Needed an `#==` method to be able to test object equality more easily so I added one in. I don't like that the `klass` is a lowercase symbol and the `klass` attribute to `.methods_by_class` is a constantized string. Want to correct that and make them uniform. Only did it this way because that's how it was suggested in the ticket. Refs #4401
2017-09-19ModelAttribute: Add `#code` methodTeddy Wing
A method that returns a string representation of the attribute, in the form `:class#:name". This will be used to store a reference to the attribute in the database. For example, a validation will reference a `ModelAttribute` in a database column using this `#code` string. Refs #4401
2017-09-19ModelAttribute spec: Allow test to handle existing elements in `@@all`Teddy Wing
When `ModelAttribute` instances are added to `@@all` directly in the class, the test breaks. Make it a little more robust by checking change in array size instead of total size. Refs #4401
2017-09-19Add `ModelAttribute`Teddy Wing
This new class will allow us to generate a list of all editable fields in all our models including the type of each field. We need this for Compliance Control, in order to get a list of fields or models & fields that can be selected to validate a given model validation check. The crucial bits here are the models, fields, and the types of those fields. These need to be defined (manually at least to begin with), accessible, and filterable. Refs #4401
2017-09-19Resolve merge conflictscedricnjanga
2017-09-19Fix compliance_control controller spec due to missing permissionsXinhui
2017-09-19Compliance Control PolicyXinhui
Refs #4543
2017-09-19Merge pull request #69 from af83/4431-permission-renamingLuc Donnet
Fixes: #4431@0.16666666666666666h;
2017-09-19Merge pull request #71 from af83/4446-spec-features-api-keysLuc Donnet
4446 spec features api keys
2017-09-19Merge branch 'master' into 4466-compliance_control_sets4466-compliance_control_setsGuillaume
2017-09-18add create/edit for compliance_control_set, add specsGuillaume
2017-09-18Fix table name compliance_check_result to compliance_check_message Refs #4390 @2Luc Donnet
2017-09-18Merge branch '4467_compliance_control_crud' into 4466-compliance_control_setsGuillaume
2017-09-15Refs: #4446@1.5h;Robert
* Make failing /delete_api_key_feature_spec pending - Seems Capybara only sees html from the partial api_keys/_form, but not the parent api_keys/edit, which happens to contain the delete link :( * ApiKeyPolicy adapted - update? depends on record's organisation as no referential present - create? depends on user's permission only as organisation will be correct anyway