Merging devlab with repo
So I finally was able to run Gen tests correctly on repo.
The patch is here for anyone who wants to take a peek at it, but be careful, it may be a little messy, because some of the conflict solving was done wrongly, and repaired with later patches. The result is good, anyway, and I thik it is really nice that a large part of the work done on making Nitro 0.31 solid can find its way into 0.40.
Now, only 20 patches are left, and not all are important (i.e. release files)
All the Nitro tests that were passing before are still passing, as for Og.. I didn’t look at the patches to it, because almost everything seem to generate a conflict, due to the recent Og/adapter refactoring.
Sadly, my admin interface at the moment is still not working (tests pass but ATM they just test that the generators library is working and creates proper files).
The problem relies basically in two things: usage of @base in the breadcrumb line, which seem easy to solve, and broken (or just different) handling of redirect, which causes errors in many actions.
Anyway, the new nitro code seems nicer than the old one, for example form is way better thean the old messy form_for, and the fact that I was able to reproduce the latter as a 3-line layer over the first is a good sign :)
In the process, I learned a lot about darcs, thanks to the nice people on the freenode #darcs channel and my friend Paolo (which is doing some uber strange things in haskelland :)
The list of my tiny additions to the nitro helpers got a new member: form_errors.
This is a nice tiny method, which uses informations stored in flash[:ERRORS] to create a tiny div filled with error messages. Basically just moved George’s new code for the scaffolding view into an helper.
So, you can have a page like this:
#{form_errors}
Insert data:
#{form_for(Person}}
and the errors’ div will just appear when loading the page with a proper flash set.
Making the test run was quite hard due to many little differences, for example the disappearing of #properties, which means that to discover the attributes of a class you need to use serializable_attributes (needed both in the administration views and in the table_for_objects helper).
This led me to a nice thing: my first usage in real life of the fail assertion, wich I used in the Unit Tests to ensure that #properties is not called anymore.
As usual, please do review my code and the patch if you can, and don’t be afraid of criticizing it, I know I’m not so good ;)
Leave a Reply (use Markdown Syntax)