+ def test_create_moderator
+ session[:user] = create(:moderator_user).id
+
+ post :create, :params => { :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[:user] = create(:moderator_user).id
+
+ post :create, :params => { :redaction => { :title => "Foo", :description => "" } }
+ assert_response :success
+ assert_template :new
+ end
+
+ def test_create_non_moderator
+ session[:user] = create(:user).id
+
+ post :create, :params => { :redaction => { :title => "Foo", :description => "Description here." } }
+ assert_response :redirect
+ assert_redirected_to :controller => "errors", :action => "forbidden"
+ end
+
+ def test_destroy_moderator_empty
+ session[:user] = create(:moderator_user).id
+
+ # create an empty redaction
+ redaction = create(:redaction)
+
+ delete :destroy, :params => { :id => redaction.id }