Browse Source

fix feature form specs offences

pull/264/head
Kat 3 years ago
parent
commit
8559d83550
  1. 4
      spec/features/form/saving_data_spec.rb
  2. 8
      spec/features/form/validations_spec.rb

4
spec/features/form/saving_data_spec.rb

@ -88,11 +88,11 @@ RSpec.describe "Form Saving Data" do
# Something about our styling makes the selenium webdriver think the actual radio buttons are not visible so we pass false here # Something about our styling makes the selenium webdriver think the actual radio buttons are not visible so we pass false here
expect(page).to have_checked_field( expect(page).to have_checked_field(
"case-log-accessibility-requirements-housingneeds-a-field", "case-log-accessibility-requirements-housingneeds-a-field",
visible: false, visible: :all,
) )
expect(page).to have_unchecked_field( expect(page).to have_unchecked_field(
"case-log-accessibility-requirements-housingneeds-b-field", "case-log-accessibility-requirements-housingneeds-b-field",
visible: false, visible: :all,
) )
end end
end end

8
spec/features/form/validations_spec.rb

@ -28,8 +28,8 @@ RSpec.describe "validations" do
let(:id) { case_log.id } let(:id) { case_log.id }
describe "Question validation" do describe "Question validation" do
context "given an invalid tenant age" do context "when the tenant age is invalid" do
it " of less than 0 it shows validation" do it "it shows validation for under 0" do
visit("/logs/#{id}/person-1-age") visit("/logs/#{id}/person-1-age")
fill_in_number_question(empty_case_log.id, "age1", -5, "person-1-age") fill_in_number_question(empty_case_log.id, "age1", -5, "person-1-age")
expect(page).to have_selector("#error-summary-title") expect(page).to have_selector("#error-summary-title")
@ -38,7 +38,7 @@ RSpec.describe "validations" do
expect(page).to have_title("Error") expect(page).to have_title("Error")
end end
it " of greater than 120 it shows validation" do it "it shows validation for over 120" do
visit("/logs/#{id}/person-1-age") visit("/logs/#{id}/person-1-age")
fill_in_number_question(empty_case_log.id, "age1", 121, "person-1-age") fill_in_number_question(empty_case_log.id, "age1", 121, "person-1-age")
expect(page).to have_selector("#error-summary-title") expect(page).to have_selector("#error-summary-title")
@ -103,7 +103,7 @@ RSpec.describe "validations" do
end end
describe "Soft Validation" do describe "Soft Validation" do
context "given a weekly net income that is above the expected amount for the given economic status but below the hard max" do context "when a weekly net income is above the expected amount for the given economic status but below the hard max" do
let(:case_log) do let(:case_log) do
FactoryBot.create( FactoryBot.create(
:case_log, :case_log,

Loading…
Cancel
Save