<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pervasive Code &#187; Google Maps</title>
	<atom:link href="http://www.pervasivecode.com/blog/category/google-maps/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pervasivecode.com/blog</link>
	<description>Jamie Flournoy's Software Development Blog</description>
	<lastBuildDate>Mon, 26 Jul 2010 05:29:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Cucumber step to test for a YM4R Google Map</title>
		<link>http://www.pervasivecode.com/blog/2009/07/27/a-cucumber-step-to-test-for-a-ym4r-google-map/</link>
		<comments>http://www.pervasivecode.com/blog/2009/07/27/a-cucumber-step-to-test-for-a-ym4r-google-map/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 03:34:46 +0000</pubDate>
		<dc:creator>Jamie Flournoy</dc:creator>
				<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.pervasivecode.com/blog/?p=116</guid>
		<description><![CDATA[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&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>I had some problems with a view in a Rails app that was conditionally hiding a Google Map that was generated using the <a href="http://ym4r.rubyforge.org/">YM4R</a> plugin. I don&#8217;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.</p>
<p>Here&#8217;s the Cucumber step implementation I wrote.<br />
<span id="more-116"></span><br />
Put this in a new file called features/step_definitions/ym4r_gm_steps.rb :</p>
<pre>
# Steps for use with the ym4r_gm plugin

Then /^I should see a Google Map$/i do
  within 'head' do
    ['http://maps.google.com/maps', '/javascripts/ym4r-gm.js'].each do |js_url|
      assert_have_xpath "//script[starts-with(@src, '#{js_url}')]"
    end
  end
  assert_select '#map_div'
end
</pre>
<p>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.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pervasivecode.com/blog/2009/07/27/a-cucumber-step-to-test-for-a-ym4r-google-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
