vitorp / matricula-web-api

5 stars 4 forks source link

Model Validations #22

Closed alexnsouza6 closed 4 years ago

alexnsouza6 commented 6 years ago

This branch contains all model validations. Besides this, it contains its specs sorted out by context.

vitorp commented 5 years ago

There are some failing tests because of the new validation. In /spec/requests/api/v1/subjects_spec.rb, this code let!(:semester_subjects) { create_list(:subject, 2, semesters: [semester]) } is failing because subject has_many semesters through offers so rails is creating an empty offer model when we add this semester. The empty offer is now invalid so the test fails. To avoid this we should create an offer manually then associate it with each subject.