From 8559d83550e6fef729d4f3f06da2a760d864849f Mon Sep 17 00:00:00 2001 From: Kat Date: Mon, 31 Jan 2022 15:54:25 +0000 Subject: [PATCH] fix feature form specs offences --- spec/features/form/saving_data_spec.rb | 4 ++-- spec/features/form/validations_spec.rb | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/features/form/saving_data_spec.rb b/spec/features/form/saving_data_spec.rb index b803a14b3..a6c56df60 100644 --- a/spec/features/form/saving_data_spec.rb +++ b/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 expect(page).to have_checked_field( "case-log-accessibility-requirements-housingneeds-a-field", - visible: false, + visible: :all, ) expect(page).to have_unchecked_field( "case-log-accessibility-requirements-housingneeds-b-field", - visible: false, + visible: :all, ) end end diff --git a/spec/features/form/validations_spec.rb b/spec/features/form/validations_spec.rb index 4aa72e261..85654a12f 100644 --- a/spec/features/form/validations_spec.rb +++ b/spec/features/form/validations_spec.rb @@ -28,8 +28,8 @@ RSpec.describe "validations" do let(:id) { case_log.id } describe "Question validation" do - context "given an invalid tenant age" do - it " of less than 0 it shows validation" do + context "when the tenant age is invalid" do + it "it shows validation for under 0" do visit("/logs/#{id}/person-1-age") fill_in_number_question(empty_case_log.id, "age1", -5, "person-1-age") expect(page).to have_selector("#error-summary-title") @@ -38,7 +38,7 @@ RSpec.describe "validations" do expect(page).to have_title("Error") end - it " of greater than 120 it shows validation" do + it "it shows validation for over 120" do visit("/logs/#{id}/person-1-age") fill_in_number_question(empty_case_log.id, "age1", 121, "person-1-age") expect(page).to have_selector("#error-summary-title") @@ -103,7 +103,7 @@ RSpec.describe "validations" do end 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 FactoryBot.create( :case_log,