Skip to content

Commit

Permalink
[rubyforgood#4504] PR feedback: specify feature flag disabled for tes…
Browse files Browse the repository at this point in the history
…t that expect errors at base level
  • Loading branch information
danielabar committed Nov 9, 2024
1 parent d1e8bfd commit 1df9599
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/models/partners/profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 1df9599

Please sign in to comment.