Is there a recommended best practice for integration tests of the infowindows? I can write a view spec for the partial, or a controller spec etc., but perhaps there's no way to integration test the infowindow contents since that all gets rendered by the browser, so short of full selenium testing are there any good options?
We're just playing around with the infowindows in our project that uses gmap4rails. Pulled stuff out into a partial as recommended:
@json = @results.to_gmaps4rails do |org, marker| marker.infowindow render_to_string(:partial => "popup", :locals => { :@org => org}) end
Partial has this:
<%= link_to "#{@org.name}", organization_path(@org) %>
and we've checked that we can match xpath with it in chrome like so:
$x("//div[@class='map_container']//a[@href='/organizations/127']")
however this doesn't work in a cucumber spec like so:
expect(page).to have_xpath("//div[@class='map_container']//a[@href='#{organization_path(org)}']")
All code in a branch here: https://github.com/tansaku/LocalSupport/tree/map_links
Is there a recommended best practice for integration tests of the infowindows? I can write a view spec for the partial, or a controller spec etc., but perhaps there's no way to integration test the infowindow contents since that all gets rendered by the browser, so short of full selenium testing are there any good options?
Would http://phantomjs.org/ help here? We are already using capybara-webkit
Many thanks in advance