vereto-api/spec/models/todo_spec.rb
2018-02-16 11:36:18 +00:00

11 lines
387 B
Ruby

require 'rails_helper'
RSpec.describe Todo, type: :model do
# Association test
# ensure Todo model has a 1:m relationship with the Item model
it { should have_many(:items).dependent(:destroy) }
# Validation tests
# ensure columns title and created_by are present before saving
it { should validate_presence_of(:title) }
it { should validate_presence_of(:created_by) }
end