|
|
@ -97,41 +97,41 @@ RSpec.describe "Test Features" do |
|
|
|
it "Cannot answer yes if no female tenants" do |
|
|
|
it "Cannot answer yes if no female tenants" do |
|
|
|
expect { |
|
|
|
expect { |
|
|
|
CaseLog.create!(pregnancy: "Yes", |
|
|
|
CaseLog.create!(pregnancy: "Yes", |
|
|
|
person_1_gender: "Male", |
|
|
|
person_1_gender: "Male", |
|
|
|
person_1_age: 20) |
|
|
|
person_1_age: 20) |
|
|
|
}.to raise_error(ActiveRecord::RecordInvalid) |
|
|
|
}.to raise_error(ActiveRecord::RecordInvalid) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "Cannot answer yes if no female tenants within age range" do |
|
|
|
it "Cannot answer yes if no female tenants within age range" do |
|
|
|
expect { |
|
|
|
expect { |
|
|
|
CaseLog.create!(pregnancy: "Yes", |
|
|
|
CaseLog.create!(pregnancy: "Yes", |
|
|
|
person_1_gender: "Female", |
|
|
|
person_1_gender: "Female", |
|
|
|
person_1_age: 51) |
|
|
|
person_1_age: 51) |
|
|
|
}.to raise_error(ActiveRecord::RecordInvalid) |
|
|
|
}.to raise_error(ActiveRecord::RecordInvalid) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "Cannot answer prefer not to say if no valid tenants" do |
|
|
|
it "Cannot answer prefer not to say if no valid tenants" do |
|
|
|
expect { |
|
|
|
expect { |
|
|
|
CaseLog.create!(pregnancy: "Prefer not to say", |
|
|
|
CaseLog.create!(pregnancy: "Prefer not to say", |
|
|
|
person_1_gender: "Male", |
|
|
|
person_1_gender: "Male", |
|
|
|
person_1_age: 20) |
|
|
|
person_1_age: 20) |
|
|
|
}.to raise_error(ActiveRecord::RecordInvalid) |
|
|
|
}.to raise_error(ActiveRecord::RecordInvalid) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "Can answer yes if valid tenants" do |
|
|
|
it "Can answer yes if valid tenants" do |
|
|
|
expect { |
|
|
|
expect { |
|
|
|
CaseLog.create!(pregnancy: "Yes", |
|
|
|
CaseLog.create!(pregnancy: "Yes", |
|
|
|
person_1_gender: "Female", |
|
|
|
person_1_gender: "Female", |
|
|
|
person_1_age: 20) |
|
|
|
person_1_age: 20) |
|
|
|
}.not_to raise_error |
|
|
|
}.not_to raise_error |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "Can answer yes if valid second tenant" do |
|
|
|
it "Can answer yes if valid second tenant" do |
|
|
|
expect { |
|
|
|
expect { |
|
|
|
CaseLog.create!(pregnancy: "Yes", |
|
|
|
CaseLog.create!(pregnancy: "Yes", |
|
|
|
person_1_gender: "Male", person_1_age: 99, |
|
|
|
person_1_gender: "Male", person_1_age: 99, |
|
|
|
person_2_gender: "Female", |
|
|
|
person_2_gender: "Female", |
|
|
|
person_2_age: 20) |
|
|
|
person_2_age: 20) |
|
|
|
}.not_to raise_error |
|
|
|
}.not_to raise_error |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|