- delete :destroy, :id => redaction.id
- assert_response :redirect
+ 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_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)