<commit_before>require "../spec_helper"

describe Crest::Form do
  describe "#generate" do
    it "generate form" do
      input = {:file => {"one" => "one", "two" => "two"}}
      parsed_input = [{"file[one]", "one"}, {"file[two]", "two"}]
      content_type = "multipart/form-data"

      form = Crest::Form.generate(input)

      form.content_type.should contain(content_type)
      form.params.should eq(input)
      form.parsed_params.should eq(parsed_input)
    end
  end
end
<commit_msg>test generate form with multipart<commit_after>require "../spec_helper"

describe Crest::Form do
  describe "#generate" do
    it "generate form" do
      input = {:file => {"one" => "one", "two" => "two"}}
      parsed_input = [{"file[one]", "one"}, {"file[two]", "two"}]
      content_type = "multipart/form-data"

      form = Crest::Form.generate(input)

      form.content_type.should contain(content_type)
      form.params.should eq(input)
      form.parsed_params.should eq(parsed_input)
    end

    it "generate form with multipart" do
      file = File.open("#{__DIR__}/../support/fff.png")
      input = {:file => file, "param1" => "value1"}

      parsed_input = [{"file", file}, {"param1", "value1"}]
      content_type = "multipart/form-data"

      form = Crest::Form.generate(input)

      form.content_type.should contain(content_type)
      form.params.should eq(input)
      form.parsed_params.should eq(parsed_input)
    end
  end
end

{'fraction_non_alphanumeric': 0.15931034482758621, 'fraction_numerical': 0.002758620689655172, 'mean_word_length': 3.2551319648093844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1035648', 'n_tokens_mistral': 480, 'n_tokens_neox': 475, 'n_words': 105}