From 09a052ef40b37159e2f0005fff74350e9fa543e6 Mon Sep 17 00:00:00 2001 From: Sam Seed Date: Wed, 11 Jan 2023 12:25:38 +0000 Subject: [PATCH] test: add line breaks and start context descriptions with and (not if) --- spec/features/lettings_log_spec.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/features/lettings_log_spec.rb b/spec/features/lettings_log_spec.rb index 24a04bbbc..963ce1f1f 100644 --- a/spec/features/lettings_log_spec.rb +++ b/spec/features/lettings_log_spec.rb @@ -110,7 +110,7 @@ RSpec.describe "Lettings Log Features" do end context "when completing the setup log section" do - context "if there is at most 1 potential stock owner" do + context "and there is at most 1 potential stock owner" do it "does not include the organisation and created by questions" do visit("/lettings-logs") click_button("Create a new lettings log") @@ -123,9 +123,10 @@ RSpec.describe "Lettings Log Features" do end end - context "if there is more than 1 potential stock owner" do + context "and there is more than 1 potential stock owner" do let!(:owning_org1) { create(:organisation, name: "Owning org 1") } let!(:org_rel1) { create(:organisation_relationship, child_organisation: user.organisation, parent_organisation: owning_org1) } + it "does include the stock owner question" do visit("/lettings-logs") click_button("Create a new lettings log") @@ -136,10 +137,11 @@ RSpec.describe "Lettings Log Features" do expect(page).to have_content("Stock owner User org") end - context "if there are more than 2 potential stock owners" do + context "and there are more than 2 potential stock owners" do let!(:owning_org2) { create(:organisation, name: "Owning org 2") } let!(:org_rel2) { create(:organisation_relationship, child_organisation: user.organisation, parent_organisation: owning_org2) } - context "if the organisation relationship for the selected stock owner is deleted" do + + context "and the organisation relationship for the selected stock owner is deleted" do it "doesn't change the CYA page text to be 'You didn't answer this question'" do visit("/lettings-logs") click_button("Create a new lettings log")