Nathan WilmesNathan Wilmes
Standup 10/8/2008 - testing Flash and routing helpers
edit Posted by Nathan Wilmes on Wednesday October 08, 2008 at 04:17PM

Ask for Help

One of our clients is looking for high-quality third-party chat services/libraries.

Interesting Things

10.5.5 and screen sharing

The Mac screen sharing application includes a host of interesting power features. Unfortunately, upgrading to Mac 10.5.5 causes these features to go away. Workarounds at this point are to store off the application and re-install it. Or to pay $300 for the official solution. Whichever.

Additional routing-related helper methods

It can be useful to create helper methods designed to extend the routing helpers offered by routes.rb.. power "_path" and "_url" methods. While the easy solution is to define these methods in your view helper layer (the most common client of these methods), a more complete solution is to use a pattern like this:

in routes.rb:

          ActionController::Routing::Routes.draw do |map|
               ... normal routes ...
          end

          ActionController::Routing::Helpers.module_eval do
             def additional_method_name
              ...
             end
          end

Any methods added to ActionController::Routing::Helpers will be available in all of the same places that named routes are defined - controllers, views, and ActionController::UrlWriter includers.

Testing Flash in Selenium

Most Flash applications render an inline image in addition to the Flash itself. This image updates as the Flash updates, and appears to be used for caching purposes.

When you're test-driving, you can make assertions about when this inline image updates to test Flash behavior. The image is binary, so it's hard to make assertions about exactly what has changed.. but it's a start.

Comments

  1. Joe Moore Joe Moore on October 09, 2008 at 03:19AM

    Regarding the Flash-generated image: it turns out that AnyChart does this to facilitate printing in Firefox, which does not print Flash very well. Read all about it here

  2. Chris Bailey Chris Bailey on October 09, 2008 at 08:09PM

    When adding helper methods to the routes file as described above, I don't seem to see those methods from an RSpec controller test, but I do see the typical restful resource or named routes helpers. Any ideas?