<commit_before>require File.dirname(__FILE__) + '/test_helper'

class EventTest < ActiveSupport::TestCase

  def setup
    @today = Time.new
    start = Time.utc(@today.year, @today.month, @today.day, Time.new.hour, Time.new.min, Time.new.sec)
    end_at = Time.at(start.to_i + 200)
    5.times do
      Event.create!(:starts_at => start.to_s, :ends_at => end_at.to_s)
    end

    @next_month = Time.new.advance(:months => 1)
    start = Time.utc(@next_month.year, @next_month.month, @next_month.day, Time.new.hour, Time.new.min, Time.new.sec)
    end_at = Time.at(start.to_i + 200)
    4.times do
      Event.create!(:starts_at => start.to_s, :ends_at => end_at.to_s)
    end
  end

  def test_creation
    start = Time.at(Time.new.to_i)
    end_at = Time.at(Time.new.to_i + 200)
    event = Event.create!(:starts_at => start.to_s, :description => 'description', :ends_at => end_at.to_s )
    assert !event.nil?
  end

  def test_view_events_today
    assert_equal 5, Event.on_day(@today).size
  end

  def test_view_events_other_day
    assert_equal 4, Event.on_day(@next_month).size
  end

  def test_view_events_this_month
    assert_equal 5, Event.in_month(@today).size
  end

  def test_view_events_other_month
    assert_equal 4, Event.in_month(@next_month).size
  end

end<commit_msg>disable event test: events are not supported yet.<commit_after># require File.dirname(__FILE__) + '/test_helper'

# class EventTest < ActiveSupport::TestCase

#   def setup
#     @today = Time.new
#     start = Time.utc(@today.year, @today.month, @today.day, Time.new.hour, Time.new.min, Time.new.sec)
#     end_at = Time.at(start.to_i + 200)
#     5.times do
#       Event.create!(:starts_at => start.to_s, :ends_at => end_at.to_s)
#     end

#     @next_month = Time.new.advance(:months => 1)
#     start = Time.utc(@next_month.year, @next_month.month, @next_month.day, Time.new.hour, Time.new.min, Time.new.sec)
#     end_at = Time.at(start.to_i + 200)
#     4.times do
#       Event.create!(:starts_at => start.to_s, :ends_at => end_at.to_s)
#     end
#   end

#   def test_creation
#     start = Time.at(Time.new.to_i)
#     end_at = Time.at(Time.new.to_i + 200)
#     event = Event.create!(:starts_at => start.to_s, :description => 'description', :ends_at => end_at.to_s )
#     assert !event.nil?
#   end

#   def test_view_events_today
#     assert_equal 5, Event.on_day(@today).size
#   end

#   def test_view_events_other_day
#     assert_equal 4, Event.on_day(@next_month).size
#   end

#   def test_view_events_this_month
#     assert_equal 5, Event.in_month(@today).size
#   end

#   def test_view_events_other_month
#     assert_equal 4, Event.in_month(@next_month).size
#   end

# end
{'fraction_non_alphanumeric': 0.13781575037147104, 'fraction_numerical': 0.01188707280832095, 'mean_word_length': 3.400326797385621, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '5865881', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1028, 'n_words': 187}