balderdashy/sails — pull request #838 by xdissent (2013-09-08 21:32:30+00:00)
Title: Handle case-sensitive filesystems when loading views.

The view tests were failing on travis because the fs is case-sensitive. Consider that no routes are explicitly set and there's a `controllers/TestViewController.js` with an `index()` action that calls `res.view()`. A request to `/testView` would correctly find the `testview` module (controller) and the `index` action would call `res.view()`, which would attempt to render `views/testview/index.ejs`. However, the actual view on disk was `views/testView/index.ejs`. You can't tell the difference on a case-insensitive fs, but on travis it was breaking the tests. To get the tests to run, I renamed the views as lowercase. This PR undoes that change and attempts to correct the behavior by preserving the case of the controller module identities. It adds an option to the module loader that passes a case-transformation function to be used when generating module identities (which just lowercases by default). The controllers hook was modified to pass a case conversion function that only lowercases the first letter of the controller module identity. Now the "correct" view is found at `views/testView/index.ejs`.