aboutsummaryrefslogtreecommitdiffstats
path: root/spec
AgeCommit message (Collapse)Author
2017-07-19Adapt test for clone policies changes (user from different organisation)cedricnjanga
2017-07-17Vehicle journey state update display full messageXinhui
Refs #4109
2017-07-12Merge pull request #30 from ↵soykje
af83/3479-migrate-all-remaining-table-builder-helper-calls-to-new-version 3479 migrate all remaining table builder helper calls to new version
2017-07-12stop_areas/show.html.erb_spec.rb: Decorate stop areaTeddy Wing
In order to get the `#action_links` method to be found by the new table builder, decorate the stop area. Refs #3479
2017-07-12routes/show.html.erb_spec.rb: Update for new table builder helperTeddy Wing
Need to decorate the stop points collection in order to be able to call `#action_links` on the objects therein. Added a stub for `pundit_user` to get around `TableBuilderHelper#table_builder_2` having a dependency on `ApplicationController#pundit_user`. Don't like this stub at all. Should be doing this in a better way. Refs #3479
2017-07-12networks/show.html.erb_spec.rb: Decorate test networkTeddy Wing
In order to get the view to render correctly and not fail on the `network.action_links` call, decorate the network used in these tests. Refs #3479
2017-07-12routes_spec.rb: Remove reference to `ReferentialLines#index`Teddy Wing
That route has been removed. Fix the test to ensure it doesn't get accessed, but still performs what was previously tested. Refs #3479
2017-07-12referential_lines_spec.rb: Remove `#index` specsTeddy Wing
Now that I removed the `ReferentialLinesController#index` method and template (c7ceb38801b853154cdae31672ff2c105c8b191f), it no longer makes sense to keep these tests around. Refs #3479
2017-07-12#4028 Clean Up end date must be greater than begin datecedricnjanga
2017-07-12CompanyDecorator#action_links: Rename `line_referential` context paramTeddy Wing
Rename this to `referential` to be more generic. This is because we could be passing both `Referential`s and `LineReferential`s into this parameter. In `CompaniesController`, we use a `LineReferential` while in `ReferentialCompaniesController` we use `Referential`. Refs #3479
2017-07-12CustomLinks: Pass referential directly when initialisingTeddy Wing
Instead of getting the referential to use when building the polymorphic URL from the `UserContext`, pass in a referential directly. The old code that used `user_context.context[:referential]` relied on the fact that `ApplicationController#pundit_user` was defined as follows: def pundit_user UserContext.new(current_user, referential: self.try(:current_referential)) end (We pass `pundit_user` into `CustomLinks` from `TableBuilderHelper#build_links`.) However, Robert's change 747d333ffbcc8ee0c9f1daf93ccca32799434e04 removes the `current_referential` call from `#pundit_user`. In `CustomLinks`, we actually always want to be using `current_referential`. For example, on `Companies#index` (/line_referentials/:id/companies), `CustomLinks` fails to build a correct #show link because `user_context.context[:referential]` is `nil`, when it should instead be a `LineReferential` object, that gets returned by the `#current_referential` helper method. Sure, `#current_referential` is hard to understand, so maybe we'll change that around in the future, but this at least allows us to use the current referential in `CustomLinks`. Refs #3479
2017-07-12CustomLinks spec: Update method name in spec describeTeddy Wing
The name of this method changed, but wasn't updated in the `describe` label.
2017-07-11hotfix to open all non standard actions on ApplicationControllerRobert
2017-07-11coherent spec file; no require (as in .rspec) and explicit RSpec.describeRobert
2017-07-11Refs #2646: fix route view testjpl
2017-07-10Refs: #4021@1.5h; Added spec for incorrectly shown `Créer` button on ↵Robert
calenders#index view and made them pass
2017-07-10Refs: #4021@0.15h; Fixes Policy TestsRobert
2017-07-10hotfixRobert
2017-07-10Action Mailer Previews for CalendarMailerXinhui
Refs #2263
2017-07-10Templating CalendarMailerXinhui
Refs #2263
2017-07-10Fixes: #3478@2.5hRobert
- Decorator Spec Setup `spec/support/decortor_helpers.rb` - Speced - Fixed
2017-07-07Merge branch 'regression_tests_user_permissions_in_controllers'Robert
2017-07-07User Permissions Computation tested in controllers vehicle_journeys and ↵Robert
journey_patterns
2017-07-07Refactoring calendar mailer move users query into observerXinhui
2017-07-07Observer for model CalendarXinhui
2017-07-07Add mailer jobXinhui
2017-07-07Add CalendarMailerXinhui
2017-07-07Add gem email_specXinhui
2017-07-06Merge branch 'master' of github.com:af83/stif-boivcedricnjanga
2017-07-06Fix test according changes in model : boundaries are exclusive for between ↵cedricnjanga
clean up
2017-07-06Merge branch 'master' of github.com:af83/stif-boivRobert
2017-07-06Comment clean test, need to fix it latercedricnjanga
2017-07-06Conflict resolvedRobert
2017-07-06TableBuilderHelper: Fix specs which mock `current_referential`Teddy Wing
These two specs were failing because of the line: current_referential ||= nil which would set `current_referential` to `nil` even after updating the object being stubbed to `helper`. Change the specs to stub the method on the correct object now that `TableBuilderHelper::URL` doesn't depend on `current_referential`. Update the faulty line in question to not clobber `current_referential`, but still give us the `nil` value we were looking for when the helper method isn't defined. Refs #3479
2017-07-06Change wording for clean up + add exclusive dates for between clean upaf83
2017-07-06Fixes: #3478@1.5hRobert
- Fixes remaining issues with LinePolicy, CalenderPolicy & RoutePolicy - Dead Code elimination
2017-07-06Refs:#3478@10h;Robert
Policy Refactoring and Policy Test Completion - All policies (and all permissions) under test. - Common patterns and potential problems identified... - ... and documented in DEVNOTES.md - some simply refactorings
2017-07-05Refs: #3478@1h;Robert
- All permissions tied to `!archived?` - Tests adapted - Policies refactored ? Is `create?` permission bound to `organisation_match?`
2017-07-04Refs: #3478@3h; Policy Cleanup and Providing Policy and permissions for all ↵Robert
models and actions - ApplicationPolicy nondestructive permission depend on model existance - ApplicationPolicy destructive permission default to `false` - Tied Policy permissions at ApplicationPolicy Level: edit? → update?, new? → create?, index? → show? - ApplicationPolicy convenience methods `delete?` & `authorizes_action?(action)` - Refactoring of `spec/helpers/table_builder_helper_spec.rb` accordingly - Stubbing scope in specs (cannot switch to referential with a `build_stubbed` instance)
2017-07-04Refs: #3478@1h removed boiv-read-offer and BoivPolicyRobert
2017-07-04Refs: #3478@0.5h; refactored table_builder_helper/custom_links.rb, according ↵Robert
to moving authoriation BL into policies
2017-07-04Refs: #3478@1h; adapted table builder spexRobert
2017-07-04Refs: #3478@1hRobert
newapplication helper default authorization, (no if) -> * DefaultPolicy (all true) * Add some policies (LinePolicy) * Use `boiv:read` pour show, index * Adapted `table_builder`
2017-07-04Refs #3961: updating wordingjpl
2017-07-04Fix workbench#show should keep filtering on sortXinhui
Refs #3871
2017-07-04Workbench#show filter by validity_period feature specXinhui
2017-07-03Workbench#show filtering restore q_for_resultXinhui
2017-07-03Refactoring workbench_controller ransack_statusXinhui
refs #3936
2017-07-03Refactoring workbench spec featuresXinhui
2017-07-03Adapt test & controller according to convert_to_timetable fixaf83