Browse Source

tenant_age validation tests

pull/47/head
Matthew Phelan 3 years ago
parent
commit
df592aa6a3
  1. 20
      spec/features/case_log_spec.rb

20
spec/features/case_log_spec.rb

@ -291,4 +291,24 @@ RSpec.describe "Test Features" do
end
end
end
describe "Question validation" do
context "given an invalid tenant age" do
it " of less than 0 it shows validation" do
visit("/case_logs/#{id}/tenant_age")
fill_in_number_question(empty_case_log.id, "tenant_age", -5)
expect(page).to have_selector("#error-summary-title")
expect(page).to have_selector("#case-log-tenant-age-error")
expect(page).to have_selector("#case-log-tenant-age-field-error")
end
it " of greater than 100 it shows validation" do
visit("/case_logs/#{id}/tenant_age")
fill_in_number_question(empty_case_log.id, "tenant_age", 120)
expect(page).to have_selector("#error-summary-title")
expect(page).to have_selector("#case-log-tenant-age-error")
expect(page).to have_selector("#case-log-tenant-age-field-error")
end
end
end
end

Loading…
Cancel
Save