<commit_before>require File.join(File.dirname(__FILE__), 'authenticated_controller_test')
require File.join(File.dirname(__FILE__), '..', 'blueprints', 'blueprints')
require File.join(File.dirname(__FILE__), '..', 'blueprints', 'helper')

require 'fastercsv'
require 'shoulda'
require 'machinist'
require 'mocha'
require 'time-warp'

class AssignmentsControllerTest < AuthenticatedControllerTest

  def setup
    @controller = AssignmentsController.new
    @request = ActionController::TestRequest.new
    @response = ActionController::TestResponse.new
    clear_fixtures
  end

  def teardown
    destroy_repos
  end

  context "An admin" do
    setup do
      @admin = Admin.make
    end

    should "be able to get new" do
      post_as @admin, :new
      assert assign_to :assignment
      assert assign_to :assignments
      assert respond_with :success<commit_msg>Add regression test for #433.<commit_after>require File.join(File.dirname(__FILE__), 'authenticated_controller_test')
require File.join(File.dirname(__FILE__), '..', 'blueprints', 'blueprints')
require File.join(File.dirname(__FILE__), '..', 'blueprints', 'helper')

require 'fastercsv'
require 'shoulda'
require 'machinist'
require 'mocha'
require 'time-warp'

class AssignmentsControllerTest < AuthenticatedControllerTest

  def setup
    @controller = AssignmentsController.new
    @request = ActionController::TestRequest.new
    @response = ActionController::TestResponse.new
    clear_fixtures
  end

  def teardown
    destroy_repos
  end

  context "An admin" do
    setup do
      @admin = Admin.make
    end

    should "be able to get new" do
      post_as @admin, :new
      assert assign_to :assignment
      assert assign_to :assignments
      assert respond_with :success
    end

    should "be able to get a new assignment form with submission rules HTML present" do
      post_as @admin, :new
      assert_not_nil response.body.to_s.match("NoLateSubmissionRule")
      assert_not_nil response.body.to_s.match("GracePeriodSubmissionRule")
      assert_not_nil response.body.to_s.match("PenaltyDecayPeriodSubmissionRule")
      assert_not_nil response.body.to_s.match("PenaltyPeriodSubmissionRule")
{'fraction_non_alphanumeric': 0.09294871794871795, 'fraction_numerical': 0.0013736263736263737, 'mean_word_length': 4.277777777777778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '245708', 'n_tokens_mistral': 670, 'n_tokens_neox': 646, 'n_words': 162}