A Cucumber step to test for a YM4R Google Map

I had some problems with a view in a Rails app that was conditionally hiding a Google Map that was generated using the YM4R plugin. I don’t usually test views in unit tests, and this logic depended on a particular situation with the data behind the view, so I decided that this would be a good candidate for a Cucumber feature.

Here’s the Cucumber step implementation I wrote.

Put this in a new file called features/step_definitions/ym4r_gm_steps.rb :

This assumes that you let the plugin installer put the .js file in the default location, and that you have your Google Map inside #map_div.

Leave a Reply

Your email address will not be published. Required fields are marked *