14 lines
439 B
Ruby
Executable File
14 lines
439 B
Ruby
Executable File
require 'rails_helper'
|
|
|
|
RSpec.describe Zone, type: :model do
|
|
# Association test
|
|
# ensure Todo model has a 1:m relationship with the Item model
|
|
it { should have_many(:seat_tables).dependent(:destroy) }
|
|
it { should have_many(:rooms).dependent(:destroy) }
|
|
|
|
# Validation tests
|
|
# ensure columns title and created_by are present before saving
|
|
it { should validate_presence_of(:name) }
|
|
it { should validate_presence_of(:created_by) }
|
|
end
|