Sha256: df7d1c473a4b1758b42a70a53718453506a76ed005e9b9372b4a22a58edf820e
Contents?: true
Size: 1.02 KB
Versions: 28
Compression:
Stored size: 1.02 KB
Contents
require "spec_helper" describe AwesomeTranslations::TranslatedValue do let(:test_file_path) { "#{Dir.tmpdir}/da.yml" } let(:translated_value) do described_class.new( file: test_file_path, key: "activerecord.attributes.test_model.test", locale: :da, value: "test" ) end before do test_translations = { "da" => { "activerecord" => { "attributes" => { "test_model" => { "test" => "test", "other_translation" => "En anden" } } } } } File.open(test_file_path, "w") do |fp| fp.write(YAML.dump(test_translations)) end end it "#save!" do translated_value.value = "new test" translated_value.save! translations = YAML.load(File.read(test_file_path)) expect(translations["da"]["activerecord"]["attributes"]["test_model"]["test"]).to eq "new test" expect(translations["da"]["activerecord"]["attributes"]["test_model"]["other_translation"]).to eq "En anden" end end
Version data entries
28 entries across 28 versions & 1 rubygems