vereto-api/spec/models/user_spec.rb

13 lines
417 B
Ruby
Raw Normal View History

2018-02-16 15:02:03 +00:00
require 'rails_helper'
RSpec.describe User, type: :model do
# Association test
# ensure User model has a 1:m relationship with the Todo model
it { should have_many(:todos) }
# Validation tests
# ensure name, email and password_digest are present before save
it { should validate_presence_of(:name) }
it { should validate_presence_of(:email) }
it { should validate_presence_of(:password_digest) }
end