Browse Source

CLDC-4312: update tests

pull/3253/head
Nat Dean-Lewis 2 months ago
parent
commit
32733741bd
  1. 18
      spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb

18
spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb

@ -19,8 +19,22 @@ RSpec.describe Form::Sales::Questions::PropertyNumberOfBedrooms, type: :model do
expect(question.type).to eq("numeric")
end
it "is not marked as derived" do
expect(question.derived?(nil)).to be false
describe "#derived?" do
context "when the log is a bedsit" do
let(:log) { build(:sales_log, proptype: 2) }
it "is marked as derived" do
expect(question.derived?(log)).to be true
end
end
context "when the log is not a bedsit" do
let(:log) { build(:sales_log, proptype: 1) }
it "is not marked as derived" do
expect(question.derived?(log)).to be false
end
end
end
it "has the correct min" do

Loading…
Cancel
Save