Brian JenkinsBrian Jenkins
Standup 11/26/2008: Assorted Incompatibilities
edit Posted by Brian Jenkins on Wednesday November 26, 2008 at 06:42PM

Interesting Things

The garbage collection bug we encountered on Monday has popped up in new places:

  • Rspec version < 1.1.11 + Linux ruby 1.8.6 patchlevel > 114 = (small explosion)

  • libxml version 0.5.4 (11 versions out of date) + Linux ruby 1.8.6 patchlevel > 114 = (another small explosion)

Also, speaking of libxml:

  • ActsAsSolr was incompatible with more recent versions of libxml, but David has submitted a fix which has been incorporated into mattmatt's github fork.

Ask for Help

"Turning off cache-busting for test environment replaces cache-busting junk with ??. Is there a way to make it replace it with nothing instead?"

With cache busting on, you have would have to test like this:

 admin_button.should have_tag("a > img[src ='/images/v3/admin/image_name.png?12121212?']")

which is awkward.

We turned it off by adding the following to config/environments/test.rb (google said to do it)

 ENV['RAILS_ASSET_ID'] = ''

But, then we had to do this:

 admin_button.should have_tag("a > img[src ='/images/v3/admin/image_name.png??']")

Is there a way to turn off cache-busting that doesn't put weird/ugly question marks at the end of your image names?

"with_tag & have_tag don't work in non-controller (e.g. model) rspecs?"

Yes, they don't. Use Hpricot instead. Or maybe assert_elements.

Comments

  1. Pat Nakajima Pat Nakajima on November 27, 2008 at 06:07AM

    Or perhaps instead of Hpricot/assert_elements, Elementor: http://pivotallabs.com/users/patn/blog/articles/608-better-view-testing-with-elementor