<commit_before>require 'test_helper'

class AvailabilityTest < ActiveSupport::TestCase
  test "length must be at least 1h" do
    a = Availability.new(start_at: Time.now, end_at: 15.minutes.from_now)
    assert a.invalid?
    assert a.errors.key?(:end_at)
  end
end<commit_msg>adds a test to availability model test<commit_after>require 'test_helper'

class AvailabilityTest < ActiveSupport::TestCase
  test "length must be at least 1h" do
    a = Availability.new(start_at: Time.now, end_at: 15.minutes.from_now)
    assert a.invalid?
    assert a.errors.key?(:end_at)
  end

  test "if type available_type is 'machines' check that there is minimum 1 association" do
    a = Availability.new(start_at: Time.now, end_at: 2.hours.from_now, available_type: 'machines')
    assert a.invalid?
    assert a.errors.key?(:machine_ids)
  end
end
{'fraction_non_alphanumeric': 0.0979689366786141, 'fraction_numerical': 0.009557945041816009, 'mean_word_length': 4.371794871794871, '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': '5810094', 'n_tokens_mistral': 292, 'n_tokens_neox': 277, 'n_words': 79}