<commit_before>require 'spec_helper'

<% module_namespacing do -%>
describe <%= class_name %> do
<%- attributes.each_with_index do |attribute, attribute_index| -%>

  # <%= attribute.name %>:<%= attribute.type %>
  <%- if attribute.type == :references -%>
  it { should allow_mass_assignment_of(:<%= attribute.name %>_id)}
  <%- else -%>
  it { should allow_mass_assignment_of(:<%= attribute.name %>)}
  <%- end -%>
  <%- if attribute.type == :references -%>
  it { should belong_to(:<%= attribute.name %>) }
  <%- end -%>
  <%- if attribute_index == 0 -%>
  it { should validate_presence_of(:<%= attributes[0].name %>) }
  <%- end -%>
  <%- if attribute.type == :boolean -%><commit_msg>belongs_to is always first item in test spec<commit_after>require 'spec_helper'

<% module_namespacing do -%>
describe <%= class_name %> do
<%- attributes.each_with_index do |attribute, attribute_index| -%>

  # <%= attribute.name %>:<%= attribute.type %>
  <%- if attribute.type == :references -%>
  it { should belong_to(:<%= attribute.name %>) }
  <%- end -%>
  <%- if attribute.type == :references -%>
  it { should allow_mass_assignment_of(:<%= attribute.name %>_id)}
  <%- else -%>
  it { should allow_mass_assignment_of(:<%= attribute.name %>)}
  <%- end -%>
  <%- if attribute_index == 0 -%>
  it { should validate_presence_of(:<%= attributes[0].name %>) }
  <%- end -%>
  <%- if attribute.type == :boolean -%>
{'fraction_non_alphanumeric': 0.2092526690391459, 'fraction_numerical': 0.0028469750889679717, 'mean_word_length': 3.8482758620689657, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '2502002', 'n_tokens_mistral': 546, 'n_tokens_neox': 493, 'n_words': 99}