Skip to content

Commit

Permalink
Fix the encrypted preference spec by allowing other calls to ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Dec 20, 2023
1 parent bfc302c commit 359448b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/spec/models/spree/preferences/preferable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ def self.allowed_admin_form_preference_types
end

it "with string, encryption key provided as env variable" do
expect(ENV).to receive(:[]).with("SOLIDUS_PREFERENCES_MASTER_KEY").and_return("VkYp3s6v9y$B?E(H+MbQeThWmZq4t7w!")
allow(ENV).to receive(:[]).and_call_original
allow(ENV).to receive(:[]).with("SOLIDUS_PREFERENCES_MASTER_KEY").and_return("VkYp3s6v9y$B?E(H+MbQeThWmZq4t7w!")
expect(Spree::Encryptor).to receive(:new).with("VkYp3s6v9y$B?E(H+MbQeThWmZq4t7w!").and_call_original

config_class_a.preference :secret, :encrypted_string

Expand Down

0 comments on commit 359448b

Please sign in to comment.