<commit_before># == Schema Information
#
# Table name: competitors
#
#  id              :integer          not null, primary key
#  event_id        :integer
#  user_id         :integer
#  created_at      :datetime
#  updated_at      :datetime
#  wingsuit_id     :integer
#  name            :string(255)
#  section_id      :integer
#  user_profile_id :integer
#

require 'rails_helper'

RSpec.describe Competitor, type: :model do
  pending 'add test to check that wingsuit and profile filled and that no second Competitor with same profile'
end<commit_msg>Added competitor model test<commit_after># == Schema Information
#
# Table name: competitors
#
#  id              :integer          not null, primary key
#  event_id        :integer
#  user_id         :integer
#  created_at      :datetime
#  updated_at      :datetime
#  wingsuit_id     :integer
#  name            :string(255)
#  section_id      :integer
#  user_profile_id :integer
#

require 'rails_helper'

RSpec.describe Competitor, type: :model do
  it 'can create profile if not set' do
    wingsuit     = create :wingsuit
    event        = create :event
    profile_name = '<NAME>Tester'

    competitor = Competitor.create(
      profile_name: profile_name,
      wingsuit: wingsuit,
      event: event
    )

    expect(competitor.user_profile.name).to eq(profile_name)
  end
end
{'fraction_non_alphanumeric': 0.078125, 'fraction_numerical': 0.004464285714285714, 'mean_word_length': 2.5866666666666664, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '7196523', 'n_tokens_mistral': 413, 'n_tokens_neox': 411, 'n_words': 119}