module ModelMacros def let_studium_lva let(:studium) {FactoryBot.create(:studium)} let(:zerosemester) {FactoryBot.create(:zero_semester,studium_id: studium.id)} let(:firstsemester) {FactoryBot.create(:first_semester)} let(:modulgruppe){FactoryBot.create(:modulgruppe,studium_id: studium.id)} let(:modul) do m=FactoryBot.build(:other_modul) m.modulgruppen << modulgruppe m.save! m end let(:lva) do l=FactoryBot.build(:lva) l.modul << modul l end end end