Sha256: 4280596cb690b2e5dee35a35b946fca1655735a0f436fbc033dcd96f0d18b228

Contents?: true

Size: 908 Bytes

Versions: 2

Compression:

Stored size: 908 Bytes

Contents

require 'rspectacular'
require 'chamber/filters/translate_secure_keys_filter'

module    Chamber
module    Filters
describe  TranslateSecureKeysFilter do
  it 'will translate keys if they start with "_secure_"' do
    filtered_settings = TranslateSecureKeysFilter.execute(
      data: {
        _secure_my_secure_setting: 'hello' })

    expect(filtered_settings.my_secure_setting).to eql 'hello'
  end

  it 'will not translate keys if they do not start with "_secure_"' do
    filtered_settings = TranslateSecureKeysFilter.execute(
      data: {
        my_secure_setting: 'hello' })

    expect(filtered_settings.my_secure_setting).to eql 'hello'
  end

  it 'will not translate the key if it starts with "secure"' do
    filtered_settings = TranslateSecureKeysFilter.execute(
      data: {
        secure_setting: 'hello' })

    expect(filtered_settings.secure_setting).to eql 'hello'
  end
end
end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chamber-2.8.0 spec/lib/chamber/filters/translate_secure_keys_filter_spec.rb
chamber-2.7.1 spec/lib/chamber/filters/translate_secure_keys_filter_spec.rb