Improved support for different version of translation cache files. Fixed test.

This commit is contained in:
Martin Edenhofer 2017-02-10 16:00:58 +01:00
parent 9b8298de28
commit 0b48c76cce

View file

@ -97,8 +97,9 @@ RSpec.describe Translation do
context 'file based import' do context 'file based import' do
it 'check download of locales' do it 'check download of locales' do
version = Version.get
directory = Rails.root.join('config') directory = Rails.root.join('config')
file = Rails.root.join("#{directory}/locales.yml") file = Rails.root.join("#{directory}/locales-#{version}.yml")
if File.exist?(file) if File.exist?(file)
File.delete(file) File.delete(file)
end end
@ -113,7 +114,7 @@ RSpec.describe Translation do
if File.directory?(directory) if File.directory?(directory)
FileUtils.rm_rf(directory) FileUtils.rm_rf(directory)
end end
file = Rails.root.join("#{directory}/#{locale}.yml") file = Rails.root.join("#{directory}/#{locale}-#{version}.yml")
expect(File.exist?(file)).to be false expect(File.exist?(file)).to be false
Translation.fetch(locale) Translation.fetch(locale)
expect(File.exist?(file)).to be true expect(File.exist?(file)).to be true