Mo Seedat
2 years ago
8 changed files with 112 additions and 5 deletions
@ -0,0 +1,8 @@
|
||||
module Validations::Sales::PropertyInformationValidations |
||||
# CLDC-858 |
||||
def validate_bedsit_has_one_room(record) |
||||
if record.bedsit? && record.beds > 1 |
||||
record.errors.add(:beds, :non_bedsit_max) |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,13 @@
|
||||
require "rails_helper" |
||||
|
||||
RSpec.describe Validations::Sales::PropertyInformationValidations do |
||||
subject(:date_validator) { validator_class.new } |
||||
|
||||
describe "#validate_bedsit_has_one_room" do |
||||
context "when property is bedsit" do |
||||
end |
||||
|
||||
context "when property is not a bedsit" do |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue