Sha256: a1168922ad6b9bd4db807cb5e075a5fdc4507cc7aa921c2964415aee95132912
Contents?: true
Size: 1.02 KB
Versions: 1
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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
awesome_translations-0.0.25 | spec/models/awesome_translations/translated_value_spec.rb |