Extract method to stub secrets in tests

This commit is contained in:
Javi Martín
2024-10-25 13:38:34 +02:00
parent 6133412ba5
commit 9f38ed6bae
7 changed files with 21 additions and 20 deletions

View File

@@ -994,7 +994,7 @@ describe User do
context "when secrets are configured" do
before do
allow(Rails.application).to receive(:secrets).and_return(ActiveSupport::OrderedOptions.new.merge(
stub_secrets(
security: {
password_complexity: true
},
@@ -1005,7 +1005,7 @@ describe User do
}
}
}
))
)
end
it "uses the general secrets for the main tenant" do
@@ -1027,7 +1027,7 @@ describe User do
context "when secrets are configured" do
before do
allow(Rails.application).to receive(:secrets).and_return(ActiveSupport::OrderedOptions.new.merge(
stub_secrets(
security: {
lockable: { maximum_attempts: "14" }
},
@@ -1038,7 +1038,7 @@ describe User do
}
}
}
))
)
end
it "uses the general secrets for the main tenant" do
@@ -1060,7 +1060,7 @@ describe User do
context "when secrets are configured" do
before do
allow(Rails.application).to receive(:secrets).and_return(ActiveSupport::OrderedOptions.new.merge(
stub_secrets(
security: {
lockable: { unlock_in: "2" }
},
@@ -1071,7 +1071,7 @@ describe User do
}
}
}
))
)
end
it "uses the general secrets for the main tenant" do