<commit_before>require 'test_helper'

# ConditionTest is the model test and validations for a condition
class ConditionTest < ActiveSupport::TestCase
  def setup
    @condition = conditions(:one)
  end

  test 'should be valid' do
    assert @condition.valid?
  end

  test 'should have a medical_conditon' do
    @condition.medical_condition = nil
    assert_not @condition.valid?, @condition.errors.full_messages.inspect
  end

  test 'should have a user' do
    @condition.user = nil
    assert_not @condition.valid?, @condition.errors.full_messages.inspect
  end
end
<commit_msg>Add test for index on medical_condition and user for an condition.<commit_after>require 'test_helper'

# ConditionTest is the model test and validations for a condition
class ConditionTest < ActiveSupport::TestCase
  def setup
    @condition = conditions(:one)
  end

  test 'should be valid' do
    assert @condition.valid?
  end

  test 'should have a medical_conditon' do
    @condition.medical_condition = nil
    assert_not @condition.valid?, @condition.errors.full_messages.inspect
  end

  test 'should have a user' do
    @condition.user = nil
    assert_not @condition.valid?, @condition.errors.full_messages.inspect
  end

  test 'index on medical_condition and user' do
    @duplicate_condition = @condition.dup
    assert_not @duplicate_condition.valid?
    assert_no_difference 'Condition.count' do
      @duplicate_condition.save
    end
  end
end

{'fraction_non_alphanumeric': 0.0726643598615917, 'fraction_numerical': 0.0, 'mean_word_length': 4.038327526132404, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5383037', 'n_tokens_mistral': 423, 'n_tokens_neox': 410, 'n_words': 133}