Sha256: 9819711ddc1d894f9fd7efa015684026a7158e3a119472c5640e69db65d811f1

Contents?: true

Size: 765 Bytes

Versions: 9

Compression:

Stored size: 765 Bytes

Contents

require 'spec_helper'

RSpec.describe RailsTranslationManager do
  describe ".locale_root" do
    it "uses the value of the environment variable RAILS_TRANSLATION_MANAGER_LOCALE_ROOT if this is set" do
      ClimateControl.modify(RAILS_TRANSLATION_MANAGER_LOCALE_ROOT: "/path/to/locales") do
        expect(RailsTranslationManager.locale_root).to eq(Pathname.new("/path/to/locales"))
      end
    end

    it "will fall back to Rails default locale location if the environment isn't set" do
      allow(Rails).to receive(:root).and_return(Pathname.new("/rails"))

      ClimateControl.modify(RAILS_TRANSLATION_MANAGER_LOCALE_ROOT: nil) do
        expect(RailsTranslationManager.locale_root).to eq(Pathname.new("/rails/config/locales"))
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_translation_manager-1.8.0 spec/rails_translation_manager_spec.rb
rails_translation_manager-1.7.0 spec/rails_translation_manager_spec.rb
rails_translation_manager-1.6.3 spec/rails_translation_manager_spec.rb
rails_translation_manager-1.6.2 spec/rails_translation_manager_spec.rb
rails_translation_manager-1.6.1 spec/rails_translation_manager_spec.rb
rails_translation_manager-1.6.0 spec/rails_translation_manager_spec.rb
rails_translation_manager-1.5.2 spec/rails_translation_manager_spec.rb
rails_translation_manager-1.5.1 spec/rails_translation_manager_spec.rb
rails_translation_manager-1.5.0 spec/rails_translation_manager_spec.rb