I want to do some basic validation to ensure that the XML sitemap is created correctly, but have_selector does not seem to be able to detect the tags:
require 'spec_helper' describe SitemapController do render_views before(:all) do
Every time I run the test, I get the following error:
RSpec::Expectations::ExpectationNotMetError: expected css "url" to return something
A site map is created, and when I debug the RSpec test and look at the response object, I can see the contents of the xml:
ruby-1.9.2-p180 :001 > response.body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n <url>\n <loc>http://test.host/panel ...
My sitemap is created by the SitemapController, and the view is in views/sitemap/index.builder.xml .
Why don't you have not_selector?
source share