+ def test_create_moderator
+ session_for(create(:moderator_user))
+
+ post redactions_path(:redaction => { :title => "Foo", :description => "Description here." })
+ assert_response :redirect
+ assert_redirected_to(redaction_path(Redaction.find_by(:title => "Foo")))
+ end
+
+ def test_create_moderator_invalid
+ session_for(create(:moderator_user))
+
+ post redactions_path(:redaction => { :title => "Foo", :description => "" })
+ assert_response :success
+ assert_template :new
+ end
+
+ def test_create_non_moderator
+ session_for(create(:user))
+
+ post redactions_path(:redaction => { :title => "Foo", :description => "Description here." })
+ assert_response :redirect
+ assert_redirected_to :controller => "errors", :action => "forbidden"
+ end
+
+ def test_destroy_moderator_empty
+ session_for(create(:moderator_user))
+
+ # create an empty redaction
+ redaction = create(:redaction)
+
+ delete redaction_path(:id => redaction)