<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -269,7 +269,29 @@ module ThoughtBot # :nodoc:
             assert_select &quot;form&quot;, true, &quot;The template doesn't contain a &lt;form&gt; element&quot;
           end
         end
-
+        
+        # Macro that creates a test asserting that the rendered view contains the selected metatags.
+        # Values can be string or Regexps.
+        # Example:
+        #
+        #   should_render_page_with_metadata :description =&gt; &quot;Description of this page&quot;, :keywords =&gt; /post/
+        #
+        # You can also use this method to test the rendered views title.
+        #
+        # Example:      
+        #   should_render_page_with_metadata :title =&gt; /index/
+        def should_render_page_with_metadata(options)
+          options.each do |key, value|
+            should &quot;have metatag #{key}&quot; do
+              if key.to_sym == :title
+                assert_select &quot;title&quot;, value
+              else              
+                assert_select &quot;meta[name=?][content#{&quot;*&quot; if value.is_a?(Regexp)}=?]&quot;, key, value
+              end
+            end
+          end          
+        end
+        
         # Macro that creates a routing test. It tries to use the given HTTP
         # +method+ on the given +path+, and asserts that it routes to the
         # given +options+.</diff>
      <filename>lib/shoulda/controller/macros.rb</filename>
    </modified>
    <modified>
      <diff>@@ -73,6 +73,8 @@ class PostsControllerTest &lt; Test::Unit::TestCase
       end
       should_assign_to :posts
       should_not_assign_to :foo, :bar
+      should_render_page_with_metadata :description =&gt; /Posts/, :title =&gt; /index/
+      should_render_page_with_metadata :keywords =&gt; &quot;posts&quot;      
     end
 
     context &quot;viewing posts for a user with rss format&quot; do</diff>
      <filename>test/functional/posts_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,8 @@
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
 &lt;head&gt;
   &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html;charset=UTF-8&quot; /&gt;
+  &lt;meta name=&quot;description&quot; content=&quot;Posts, posts and more posts&quot; /&gt;
+	&lt;meta name='keywords' content='posts' /&gt;
   &lt;title&gt;Posts: &lt;%= controller.action_name %&gt;&lt;/title&gt;
   &lt;%= stylesheet_link_tag 'scaffold' %&gt;
 &lt;/head&gt;</diff>
      <filename>test/rails_root/app/views/layouts/posts.rhtml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d06e0207244b5f23e62199aa691619136900358d</id>
    </parent>
  </parents>
  <author>
    <name>Chris O'Sullivan</name>
    <email>thechrisoshow@gmail.com</email>
  </author>
  <url>http://github.com/thechrisoshow/shoulda/commit/8de4e3ee539e92fadb04afe535c2a147d8d69947</url>
  <id>8de4e3ee539e92fadb04afe535c2a147d8d69947</id>
  <committed-date>2008-11-18T14:59:04-08:00</committed-date>
  <authored-date>2008-11-18T14:59:04-08:00</authored-date>
  <message>Added new method should_render_page_with_metadata with tests [#61]</message>
  <tree>d8ce9edb7f218b87f239f1b44de4666f4040ee3d</tree>
  <committer>
    <name>Chris O'Sullivan</name>
    <email>thechrisoshow@gmail.com</email>
  </committer>
</commit>
