|
|
|
|
@ -84,5 +84,18 @@ RSpec.describe Validations::SharedValidations do
|
|
|
|
|
expect(record.errors["needstype"]).to be_present |
|
|
|
|
expect(record.errors["needstype"]).to eql(["Enter a valid value for needs type"]) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when feature is toggled off" do |
|
|
|
|
before do |
|
|
|
|
allow(FeatureToggle).to receive(:validate_valid_radio_options?).and_return(false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "allows any values" do |
|
|
|
|
record.needstype = 3 |
|
|
|
|
shared_validator.validate_valid_radio_option(record) |
|
|
|
|
|
|
|
|
|
expect(record.errors["needstype"]).to be_empty |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|