| Age | Commit message (Collapse) | Author |
|
Use policies to determine if a user is allowed to share a calendar,
instead of a hardcoded string
|
|
- add missing policies
- update permissions translator
- update views to check for the permission
- update views helper to check for the permission
- uipdate controllers to check for the permission
|
|
- Renaming as requested STIF::NetexFile::Frame.get_line_object_id -> get_sgort_id
- working on error_messages for imports#show
|
|
Implementing allowed vs foreign line lookup for the zip service
- Adapting `lib/stif/netex_file.rb` to expose the already implemented matching
- `app/services/zip_service.rb` augmented to check for allowed lines and returning forbidden lines
- Specs with fixtures and using the beforementioned new zip support in the specs
- Fixture directories for the new specs
|
|
|
|
|
|
The `ComplianceControlSetCopyWorker` depends on
`ComplianceControlSetCopier#copy` to return the `ComplianceCheckSet`
that it creates.
Refs #4782
|
|
|
|
|
|
ComplianceControlSet
|
|
compliance_control code Refs #4731
|
|
DONE:
- Copied all node atts for ComplianceChecks
- Migration of CompliancCheck#criticity int -> string
TODO:
- Check what to do with attribute ComplianceCheck#type
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
Enables finding a `ModelAttribute` by a string code combining klass and
name.
Refs #4401
|
|
This returns all defined `ModelAttribute`s as a hash of class keys
containing lists of the attributes they contain.
Refs #4401
|
|
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
|
|
This enables filtering by class like `.methods_by_class` and
additionally only selecting attributes matching a certain data type.
Refs #4401
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
Fixes: #4431@0.16666666666666666h;
|
|
|
|
|
|
|
|
from real data. Refs #4273
|
|
3507 1726 impl workbench import
|
|
|
|
lib/stif/permission_translator
|
|
|
|
|
|
|
|
|
|
|
|
tests""
This reverts commit b0e6bc3ffd02146fd999f12975f269dac94a0994.
Reinstate the updated `TimeDuration` spec code. Seems like this was
reverted by accident. Robert was doing a complicated merge/rebase and
somehow in the mix this commit ended up being unintentionally reverted.
> 16:23:26 +0200 < robert> @teddy merge idiosynchrasy I did not touch these specs deliberately but must have pulled in the old version by error sorry
> 16:24:19 +0200 < robert> I had some strange conflicts and rebased twice, hmmm, strange though I just did not touch these specs for months
> ...
> 16:25:10 +0200 < robert> anywyay feelfree to undo my undoing :blush:
|
|
This reverts commit 52d2c968cac7e901b8e6fa3d1be115239b7c5937.
|
|
Change the variable names to `earlier` and `later`, and use explicit
`true` and `false` values to be consistent with the newer tests in this
file. The new variable names in particular should be a little quicker to
understand.
Refs #870
|
|
Previously, the `#exceeds_gap?` method would modulo the
`later - earlier` duration against 24 hours such that no duration
exceeded 24 hours, and the resulting duration being compared was
adjusted to fit inside a single day.
When we removed the numbers from `exceeds_gap?`, we also removed the
modulo operation. I had a feeling that would potentially cause problems,
and it turns out it did. Though it still took too much investigation
time to realise that the most obvious answer was in fact the correct
one. Blame the confusing test failures if I will:
Failures:
1) Chouette::VehicleJourney state_update should return errors when validation failed
Failure/Error: expect(state['errors'][:vehicle_journey_at_stops].size).to eq 1
NoMethodError:
undefined method `[]' for nil:NilClass
# ./spec/models/chouette/vehicle_journey_spec.rb:148:in `block (3 levels) in <top (required)>'
2) Chouette::VehicleJourney state_update vehicle_journey_at_stops should return errors when validation failed
Failure/Error: expect(item['errors'][:arrival_time].size).to eq 1
NoMethodError:
undefined method `[]' for nil:NilClass
# ./spec/models/chouette/vehicle_journey_spec.rb:189:in `block (4 levels) in <top (required)>'
3) VehicleJourneyImport.save should not import vehicle_journeys and not create objects when vehicle journey at stops are not in ascendant order
Failure/Error: expect(VehicleJourneyImport.new(:route => route, :file => invalid_file_on_vjas_object).save).to be_falsey
expected: falsey value
got: true
# ./spec/models/vehicle_journey_import_spec.rb:90:in `block (3 levels) in <top (required)>'
Finished in 4 minutes 20.7 seconds (files took 14.47 seconds to load)
1089 examples, 3 failures, 23 pending
Failed examples:
rspec ./spec/models/chouette/vehicle_journey_spec.rb:137 # Chouette::VehicleJourney state_update should return errors when validation failed
rspec ./spec/models/chouette/vehicle_journey_spec.rb:183 # Chouette::VehicleJourney state_update vehicle_journey_at_stops should return errors when validation failed
rspec ./spec/models/vehicle_journey_import_spec.rb:89 # VehicleJourneyImport.save should not import vehicle_journeys and not create objects when vehicle journey at stops are not in ascendant order
These three tests failed with my version of `exceeds_gap?`.
To correct the failures, add back in the 24-hour adjustment. Put it in a
named method that is hopefully clear enough to understand.
The second test failure ("vehicle_journey_at_stops should return errors
when validation failed") used two times that were the same. I decided to
add a test for this because it seemed like an interesting edge case. The
test I added didn't fail even for the previous version of
`.exceeds_gap?`, but I figure it seems like a useful test anyway.
Refs #870
|
|
These are holdovers from when these specs were copied from
`vehicle_journey_at_stop_spec.rb`. They're not used in our specs now so
get rid of them.
Refs #870
|
|
Take the specs out of the `IncreasingTimeOrderValidator` spec and move
them into `TimeDuration`. This is part of the consolidation and complete
move of the `exceeds_gap?` method into `TimeDuration`.
Add a context to the two test blocks that specifies the duration at a 4
hour gap. Currently the implementation doesn't do anything with that
argument, but this makes it clearer that we're using a four hour
duration.
Refs #870
|
|
|
|
|
|
Range#intersection
|