Sha256: 4e8057792b06df05bd615b16edd056d51a0c64c52a2e8a1a46eda172608186d7

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

module Refinery
  module Authentication
    module Devise
      describe 'configuration' do

        describe '.email_from_name' do
          # reset any previously defined email from name
          before do
            Refinery::Authentication::Devise.email_from_name = nil
          end

          context 'when set in configuration' do
            it 'returns name set by Refinery::Authentication::Devise.config' do
              allow(Refinery::Authentication::Devise).to receive(:email_from_name).and_return('support')
              expect(Refinery::Authentication::Devise.email_from_name).to eq('support')
            end
          end

          context 'when set in locale file' do
            before do
              ::I18n.backend.store_translations :en, :refinery => {
                :authentication => {
                  :config => {
                    :email_from_name => 'supporto'
                  }
                }
              }
            end

            it 'returns name set in locale' do
              expect(Refinery::Authentication::Devise.email_from_name).to eq('supporto')
            end
          end
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
refinerycms-authentication-devise-2.0.0 spec/lib/refinery/authentication/devise/configuration_spec.rb
refinerycms-authentication-devise-1.0.4 spec/lib/refinery/authentication/devise/configuration_spec.rb
refinerycms-authentication-devise-1.0.3 spec/lib/refinery/authentication/devise/configuration_spec.rb
refinerycms-authentication-devise-1.0.2 spec/lib/refinery/authentication/devise/configuration_spec.rb
refinerycms-authentication-devise-1.0.1 spec/lib/refinery/authentication/devise/configuration_spec.rb
refinerycms-authentication-devise-1.0.0 spec/lib/refinery/authentication/devise/configuration_spec.rb