Sha256: c7cd918b2591fb0d35916dec5158ec70edb25bf6afb004ea01ae534ede1daeae

Contents?: true

Size: 719 Bytes

Versions: 2

Compression:

Stored size: 719 Bytes

Contents

require 'rails_helper'

RSpec.describe EmailPrefixer::Configuration do
  before do
    EmailPrefixer.configuration.application_name = 'MyApp'
  end

  describe EmailPrefixer::Configuration::DEFAULT_BUILDER do
    describe '#call' do
      subject { EmailPrefixer::Configuration::DEFAULT_BUILDER.call }
      context 'when stage_name == production' do
        before do
          EmailPrefixer.configuration.stage_name = 'production'
        end
        it { is_expected.to eq '[MyApp] ' }
      end
      context 'when stage_name != production' do
        before do
          EmailPrefixer.configuration.stage_name = 'staging'
        end
        it { is_expected.to eq '[MyApp STAGING] ' }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
email_prefixer-1.2.0 spec/lib/email_prefixer/configuration_spec.rb
email_prefixer-1.2.0.pre.1 spec/lib/email_prefixer/configuration_spec.rb