<commit_before>require 'spec_helper'
require 'roles/planned_timetable_slot'
require 'models/person'
require 'sirius/time_converter'
require 'sirius/event_planner'

describe PlannedTimetableSlot do

  describe '#generate_events' do

    let(:slot) { TimetableSlot.new(first_hour: 1, duration: 2, parity: :both, day: :monday) }
    let(:period) { Period.parse('7:30', '9:00') }
    let(:converter) { instance_double(Sirius::TimeConverter, convert_time: period) }
    let(:event_planner) { instance_double(Sirius::EventPlanner, plan: [period]) }
    subject(:planned_slot) { described_class.new(slot, converter, event_planner) }

    it 'converts Timetableslot to events' do
      events = planned_slot.generate_events
      expect(events.size).to be > 0
      expect(events.first).to be_an_instance_of(Event)
    end

  end

end
<commit_msg>Primary key is required for #generate_events.<commit_after>require 'spec_helper'
require 'roles/planned_timetable_slot'
require 'models/person'
require 'sirius/time_converter'
require 'sirius/event_planner'

describe PlannedTimetableSlot do

  describe '#generate_events' do

    let(:slot) { Fabricate(:timetable_slot, first_hour: 1, duration: 2, parity: :both, day: :monday) }
    let(:period) { Period.parse('7:30', '9:00') }
    let(:converter) { instance_double(Sirius::TimeConverter, convert_time: period) }
    let(:event_planner) { instance_double(Sirius::EventPlanner, plan: [period]) }
    subject(:planned_slot) { described_class.new(slot, converter, event_planner) }

    it 'converts Timetableslot to events' do
      events = planned_slot.generate_events
      expect(events.size).to be > 0
      expect(events.first).to be_an_instance_of(Event)
    end

  end

end

{'fraction_non_alphanumeric': 0.11925538103548575, 'fraction_numerical': 0.010471204188481676, 'mean_word_length': 5.164874551971326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3618650', 'n_tokens_mistral': 596, 'n_tokens_neox': 559, 'n_words': 118}