Reinstate inheritance integration spec#509
Conversation
'resources' used to be available in router, now it's in hanami/hanami So this is a suitable replacement
timriley
left a comment
There was a problem hiding this comment.
Good to have this back, thank you!
This never really needed to be tied to resource-based organisation of actions in the first place, anyway. This is just straightforward testing of inheritance and its impact on callbacks/super, etc.
| end | ||
| end | ||
|
|
||
| module Controllers |
There was a problem hiding this comment.
Future TODO: remove all instances of the "Controller" terminology even from our test class namespaces (I felt that was too much to bite off with the initial rename PR).
|
@cllns Regarding fixtures — one of the things we avoid in this test suite by using fixtures is class names leaking between tests. Right now we don't have any machinery to clean up constants after tests, etc., so if we happened to want to define Maybe we could use anonymous classes here to avoid that? |
Named constants leak for the lifetime of the test suite, since anonymous classes define no constants and are truly isolated.
|
Ah great point Tim. I switched to use anonymous classes. This require re-working the spec since we were passing the class name along, which anonymous classes don't have. Instead I used #object_id which is a suitable replacement. |
resourcesused to be available in router, now it's in hanami/hanamiSo this is a suitable replacement!
I also moved the module with its classes into the spec. I think of Fixtures as a place for shared things. It's easier to read this spec in isolation without having to go to fixtures file.