Sha256: 9b37b9342f651a23f2dbec530a96def2e6147aca9f4bf8e05bfa6faa280cdae9
Contents?: true
Size: 1.12 KB
Versions: 16
Compression:
Stored size: 1.12 KB
Contents
require 'spec_helper' require_relative '../../../../../lib/locomotive/steam/adapters/filesystem/yaml_loader.rb' require_relative '../../../../../lib/locomotive/steam/adapters/filesystem/yaml_loaders/translation.rb' describe Locomotive::Steam::Adapters::Filesystem::YAMLLoaders::Translation do let(:site_path) { default_fixture_site_path } let(:loader) { described_class.new(site_path) } describe '#load' do let(:scope) { instance_double('Scope', locale: :en) } subject { loader.load(scope) } it 'tests various stuff' do expect(subject.size).to eq 8 expect(subject.first[:key]).to eq('powered_by') expect(subject.first[:values]).to eq({ 'en' => 'Powered by', 'fr' => 'Propulsé par' }) end context 'a different environment' do let(:loader) { described_class.new(site_path, :production) } it 'replaces the data with the ones from the production environment' do expect(subject.size).to eq 1 expect(subject.first[:key]).to eq('hello_world') expect(subject.first[:values]).to eq('en' => 'Hello world', 'fr' => 'Bonjour le monde') end end end end
Version data entries
16 entries across 16 versions & 1 rubygems