<commit_before>require 'spec_helper'

describe "post data with params" do
  before do
    visit '/tests/model_form'
    # puts page.body
  end
  
  describe "filling in a honeypot" do
    before do
      fill_in 'post[subject]', :with => "this is a subject"
      click_button 'submit'
    end
    
    it "should be considered a bot" do
      page.should have_content('suspected_bot')
    end
    
    it "should not include legit params" do
      page.should_not have_content("subject:")
    end
  end

  describe "filling in a legit field" do
    before do
      fill_in '00a1168ac1379bdbe9b59e678fe486b1', :with => "this is a subject"
      click_button 'submit'
    end
    
    it "should have legit params" do
      page.should have_content('subject: this is a subject')
    end
    
    it "should not be considered a bot" do
      page.should_not have_content('suspected_bot')<commit_msg>altered specs so that they're hopefully more friendly to ruby-head<commit_after>require 'spec_helper'

describe "post data with params" do
  before do
    visit '/tests/model_form'
    # puts page.body
  end
  
  describe "filling in a honeypot" do
    before do
      fill_in 'post[subject]', :with => "this is a subject"
      click_button 'submit'
    end
    
    it "should be considered a bot" do
      page.should have_content('suspected_bot')
    end
    
    it "should not include legit params" do
      page.should_not have_content("subject:")
    end
    
    it "should drop data from the honeypots" do
      page.should_not have_content("this is a subject")
    end
  end

  describe "filling in a legit field" do
    before do
      fill_in '00a1168ac1379bdbe9b59e678fe486b1', :with => "this is a subject"
      click_button 'submit'
    end
    
    it "should have kept legit data" do
      page.should have_content('this is a subject')
    end
    
    it "should not be considered a bot" do
      page.should_not have_content('suspected_bot')
{'fraction_non_alphanumeric': 0.0745658835546476, 'fraction_numerical': 0.020429009193054137, 'mean_word_length': 2.7314285714285713, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5308058', 'n_tokens_mistral': 648, 'n_tokens_neox': 605, 'n_words': 214}