Sean Beckett's blog
Interesting Things
- When using time zones in Rails 2.1, if you specify a zone, any datetime ActiveRecord attributes will be returned in that zone. E.g. if you specify Eastern Time, and then later request changed_at from an ActiveRecord, it will be returned in ET. However, if you ask for
Time.nowit is always returned in the local time zone, regardless of TZ settings. This isn't necessarily bad or unexpected behavior, but it can lead to test failures if you save a time to an ActiveRecord, get it back, and then compare the values. One workaround is to useTime.zone.now, which will always respect the current time zone, although this doesn't help with large existing codebases.
Ask for Help
"We're FlexMock for some of our Test::Unit unit tests, and recently added some new tests; nothing that is exercising new parts of the code or creating new mocks. However, for some reason when we call previously existing mocks we get errors from Rspec. These are not exceptions or assertion failures, but full-stop errors as if there were a syntax error. Turns out Rspec reopens the Test::Unit::TestCase class and overwrites some behavior, although the cause of the errors remain entirely unclear. Anyone know why it would do that and how to prevent it in the future?"
A few people mumbled about Rspec magic, but actual help was not immediately forthcoming.
Interesting Things
- If you're having problems with JSUnit not loading in Firefox 3, load the about:config settings and search for 'origin'. You'll want to change the
security.fileuri.strict_origin_policyvalue from 'true' to 'false'. JSUnit should now initialize properly, although you still won't see a Browse button.
Ask for Help
"Does anyone know why a Selenium click event might not trigger the same activity as directly triggering the DOM id through javascript? We have a form submit button that works fine when directly activated but doesn't work in Selenium."
It was suggested that perhaps this is a timing issue. Maybe some required JS for the form hasn't loaded before Selenium is trying the event.
One workaround would be to test only the form submission called by on-click instead of the click itself.
