<commit_before>require  File.expand_path(File.dirname(__FILE__)) + "/../../../../../../spec/spec_helper"

require  File.expand_path(File.dirname(__FILE__)) + '/../../forum_test_helper'

describe Forum::AdminController do

  include ForumTestHelper

  it "should be able to create categories" do
    mock_editor

    get 'options'
  end
<commit_msg>Setup testing for the admin controller<commit_after>require  File.expand_path(File.dirname(__FILE__)) + "/../../../../../../spec/spec_helper"

require  File.expand_path(File.dirname(__FILE__)) + '/../../forum_test_helper'

describe Forum::AdminController do

  include ForumTestHelper

  it "should be able to create categories" do
    mock_editor

    assert_difference 'ForumCategory.count', 1 do
      post 'category', :path => [], :forum_category => { :name => 'Test Category', :content_filter => 'markdown_safe' }
      @forum_category = ForumCategory.find(:last)
      response.should redirect_to(:controller => '/forum/manage', :action => 'category', :path => @forum_category.id)
    end
  end

  it "should be able to edit a category" do
    mock_editor

    @forum_category = create_forum_category 'Change This Forum Category Name'
    @forum_category.save.should be_true

    assert_difference 'ForumCategory.count', 0 do
      post 'category', :path => [@forum_category.id], :forum_category => { :name => 'Test Category' }
      @forum_category.reload
      response.should redirect_to(:controller => '/forum/manage', :action => 'category', :path => @forum_category.id)
      @forum_category.name.should == 'Test Category'
    end
  end

  it "should be able to delete a category" do
    mock_editor

    @forum_category = create_forum_category 'Delete This Forum Category'
    @forum_category.save.should be_true

    assert_difference 'ForumCategory.count', -1 do
      post 'delete', :path => [@forum_category.id], :destroy => 'yes'
      response.should redirect_to(:controller => '/content', :action => 'index')
    end
  end

{'fraction_non_alphanumeric': 0.1371859296482412, 'fraction_numerical': 0.001507537688442211, 'mean_word_length': 3.7180094786729856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7479544', 'n_tokens_mistral': 609, 'n_tokens_neox': 565, 'n_words': 151}