[Instiki-devel] Instiki-ar tests pass, live instance running
Rick Olson
technoweenie at gmail.com
Sun Aug 7 01:36:29 EDT 2005
Hey guys, I just wanted to let you know that I got Instiki running on
ActiveRecord. All tests pass locally on postgresql, mysql, sqlite2,
and sqlite3. I have an instance at
http://instiki-ar.techno-weenie.net:2533/ running on lighttpd and
sqlite.
First thing: I wasn't able to make checkins. My login doesn't seem to
work. I have diff files at 5 milestones along the way, so hopefully I
can get a decent revision history in there.
All the non-AR code (chunks, diffs, etc) were virtually untouched.
This allowed a portion of the unit tests to run with very little
changes. As for the models themselves, I did my best to keep the same
interfaces. Here are the areas I ran into difficulty:
WikiService - I changed this to a Wiki class with most of the same
functionality. Instead of a persistent object, it gets recreated on
each request. I had to make some slight changes to the controllers,
but nothing major.
Web boolean options - These get modeled differently in the DB, so I
had to use the ? method (published? count_pages? etc).
Model constructors - I changed the constructors to take an options
hash like other AR objects. This wasn't a big deal since the
controllers access methods like @wiki.read_page for everything.
Tests were a huge challenge. I converted some of the setup methods
into fixtures, but this threw a lot of things off (counts, RSS feeds,
etc). Most of my changes were adding pages that were nonexistent
before. Another test issue had to do with madeleine. Since the
objects were always in memory, modifying a page in the controller
would also modify the same object in the test. This isn't so with
ActiveRecord, so there are many places that I'm forcing the reload of
fixture data or has_many associations.
--
rick
http://techno-weenie.net
More information about the Instiki-devel
mailing list