module Shoulda::ActionView::Macros
def should_render_page_with_metadata(options)
Example:
You can also use this method to test the rendered views title.
should_render_page_with_metadata :description => "Description of this page", :keywords => /post/
Example:
Values can be string or Regexps.
Macro that creates a test asserting that the rendered view contains the selected metatags.
def should_render_page_with_metadata(options) options.each do |key, value| should "have metatag #{key}" do if key.to_sym == :title assert_select "title", value else assert_select "meta[name=?][content#{"*" if value.is_a?(Regexp)}=?]", key, value end end end end