<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,7 +2,7 @@ ActionController::Routing::Routes.draw do |map|
   map.resource :session
   map.resources :users
   map.resources :drafts, :only =&gt; :index
-  map.resources :moderations
+  map.resources :moderations, :except =&gt; [:new, :edit]
   map.resources :pages
 
   map.with_options :controller =&gt; 'posts',:action =&gt; 'index' do |page|</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,53 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
+class ModerationsController
+  def rescue_action(e) raise e end
+end
+
 class ModerationsControllerTest &lt; ActionController::TestCase
-  # Replace this with your real tests.
-  def test_truth
-    assert true
+
+  def setup
+    login_as(:quentin)
+  end
+
+  def test_should_get_index
+    get :index
+    assert_response :success
+    assert_not_nil assigns(:comments)
+    assert !assigns(:comments).any?{|c| c.moderated?}
+  end
+
+  def test_should_show_moderation_for_unmoderated_comment
+    get :show, {:id =&gt; comments(:sample_post_unmoderated_comment).id}
+    assert_response :success
+    assert_not_nil assigns(:comment)
+  end
+
+  def test_should_show_moderation_for_moderated_comment
+    assert_raise(ActiveRecord::RecordNotFound) do
+      get :show, {:id =&gt; comments(:sample_post_moderated_comment).id}
+    end
+    # assert_response :not_found # maybe this only works in production?
+    assert_nil assigns(:comment)
+  end
+
+  def test_should_update_moderation
+    p = posts(:sample_post)
+    comment = p.comments.unmoderated.first
+    assert_difference('p.comments.unmoderated.count', -1) do
+      put :update, :id =&gt; comment.id
+    end
+    assert_redirected_to moderations_url
+    assert /^Moderated comment by &lt;em&gt;#{comment.author}/.match(flash[:notice])
+  end
+
+  def test_should_destroy_moderation
+    p = posts(:sample_post)
+    comment = p.comments.unmoderated.first
+    assert_difference('p.comments.count', -1) do
+      delete :destroy, :id =&gt; comment.id
+    end
+    assert_redirected_to moderations_url
+    assert /^Deleted comment by &lt;em&gt;#{comment.author}/.match(flash[:notice])
   end
 end</diff>
      <filename>test/functional/moderations_controller_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>940627a26fdf927d3f2e578bacabee8ca3de41d6</id>
    </parent>
  </parents>
  <author>
    <name>mrchucho</name>
    <email>mrchucho@mrchucho.net</email>
  </author>
  <url>http://github.com/mrchucho/bbot/commit/537c5a12873a8c60713ce62b314ce3a9add7173c</url>
  <id>537c5a12873a8c60713ce62b314ce3a9add7173c</id>
  <committed-date>2009-10-09T13:45:47-07:00</committed-date>
  <authored-date>2009-10-09T13:45:47-07:00</authored-date>
  <message>ModerationsController functional tests.</message>
  <tree>11c9d99d9cf9285cee850c5fb5ca17be843f4b4f</tree>
  <committer>
    <name>mrchucho</name>
    <email>mrchucho@mrchucho.net</email>
  </committer>
</commit>
