mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
Adjust context using allow method for Application Record spec
This commit is contained in:
committed by
Filipe
parent
cab4b2fb28
commit
252943e9de
@@ -10,21 +10,20 @@ RSpec.describe ApplicationRecord do
|
||||
|
||||
context "with a S3 bucket defined" do
|
||||
before do
|
||||
expect(ENV).to receive(:[]).with("S3_BUCKET").and_return("test-bucket")
|
||||
expect(ENV).to receive(:[]).with("S3_ENDPOINT").and_return(nil)
|
||||
allow(ENV).to receive(:[]).with("S3_BUCKET").and_return("test-bucket")
|
||||
allow(ENV).to receive(:[]).with("S3_ENDPOINT").and_return(nil)
|
||||
end
|
||||
|
||||
it { is_expected.to eq(:amazon_public) }
|
||||
end
|
||||
|
||||
context "with a S3 bucket and endpoint defined" do
|
||||
before do
|
||||
expect(ENV).to receive(:[]).with("S3_BUCKET").and_return("test-bucket")
|
||||
expect(ENV).to receive(:[]).with("S3_ENDPOINT")
|
||||
.and_return("https://s3-compatible-alternative.com")
|
||||
context "with a S3 endpoint defined" do
|
||||
before do
|
||||
allow(ENV).to receive(:[]).with("S3_ENDPOINT")
|
||||
.and_return("https://s3-compatible-alternative.com")
|
||||
end
|
||||
|
||||
it { is_expected.to eq(:s3_compatible_storage_public) }
|
||||
end
|
||||
|
||||
it { is_expected.to eq(:s3_compatible_storage_public) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user