From 1df95991016d964a75d42a332527f4734c8b205e Mon Sep 17 00:00:00 2001 From: Daniela Baron Date: Sat, 9 Nov 2024 06:29:57 -0500 Subject: [PATCH] [#4504] PR feedback: specify feature flag disabled for test that expect errors at base level --- spec/models/partners/profile_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/models/partners/profile_spec.rb b/spec/models/partners/profile_spec.rb index d303182bd4..80a6cb0c05 100644 --- a/spec/models/partners/profile_spec.rb +++ b/spec/models/partners/profile_spec.rb @@ -97,13 +97,16 @@ subject { build(:partner_profile, enable_child_based_requests: false, enable_individual_requests: false, enable_quantity_based_requests: false) } context "no settings are set to true" do - it "should not be valid" do + it "sets error at base when feature flag disabled for partner step form" do + allow(Flipper).to receive(:enabled?).with("partner_step_form").and_return(false) + expect(subject).to_not be_valid expect(subject.errors[:base]).to include("At least one request type must be set") end it "sets error at field level when feature flag enabled for partner step form" do allow(Flipper).to receive(:enabled?).with("partner_step_form").and_return(true) + expect(subject).to_not be_valid expect(subject.errors[:enable_child_based_requests]).to include("At least one request type must be set") end @@ -262,7 +265,9 @@ end context "multiple" do - it "sums the client shares " do + it "sums the client shares and sets error at base when feature flag disabled for partner step form" do + allow(Flipper).to receive(:enabled?).with("partner_step_form").and_return(false) + profile = create(:partner_profile) county1 = create(:county, name: "county1", region: "region1") county2 = create(:county, name: "county2", region: "region2")