<commit_before>require 'rails_helper'

describe "Paper page", :type => :feature do
  
  it "should create an paper instance when the user creates a paper" do
    visit new_paper_path
    fill_in 'Title', with: 'COMPUTING MACHINERY AND INTELLIGENCE'
    fill_in 'Venue', with: 'Mind 49: 433-460'
    fill_in 'Year', with: '1950'
	
	click_button 'Create paper'    
    expect(Paper.where(title:"COMPUTING MACHINERY AND INTELLIGENCE", venue:"Mind 49: 433-460", year:"1950")).to exist
  end
  it "should show validation errors" do
    visit new_paper_path
    fill_in 'Title', with: ''
    fill_in 'Venue', with: ''
    fill_in 'Year', with: 'nineteen-fifty'
  
    click_button 'Create paper'    
    expect(page).to have_text("Title can't be blank")
    expect(page).to have_text("Venue can't be blank")
    expect(page).to have_text("Year is not a number")
    
  end
  it "should not containt 'go to statement considered harmful'" do
  visit new_paper_path
    @papers = [create(:paper), create(:paper2)]

  end

end<commit_msg>Finished<commit_after>require 'rails_helper'

describe "Paper page", :type => :feature do
  
  it "should create an paper instance when the user creates a paper" do
    visit new_paper_path
    fill_in 'Title', with: 'COMPUTING MACHINERY AND INTELLIGENCE'
    fill_in 'Venue', with: 'Mind 49: 433-460'
    fill_in 'Year', with: '1950'
	
	click_button 'Create paper'    
    expect(Paper.where(title:"COMPUTING MACHINERY AND INTELLIGENCE", venue:"Mind 49: 433-460", year:"1950")).to exist
  end
  it "should show validation errors" do
    visit new_paper_path
    fill_in 'Title', with: ''
    fill_in 'Venue', with: ''
    fill_in 'Year', with: 'nineteen-fifty'
  
    click_button 'Create paper'    
    expect(page).to have_text("Title can't be blank")
    expect(page).to have_text("Venue can't be blank")
    expect(page).to have_text("Year is not a number")
    
  end
 
end
{'fraction_non_alphanumeric': 0.11379129522810698, 'fraction_numerical': 0.025694808599895123, 'mean_word_length': 3.746268656716418, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6600530', 'n_tokens_mistral': 695, 'n_tokens_neox': 629, 'n_words': 199}