require 'spec_helper' describe Aigu::Exporter do describe :flattenize_content_values do let(:exporter) { described_class.new } let(:flattenized_content) { exporter.send(:flattenize_content_values, content) } let(:content) do { 'users.fr|fr.users.index.title' => 'Foo', 'users.fr|fr.users.index.actions' => [ 'Bar', true, 'LOL' ], 'users.fr|fr.users.index.footer' => 'Bla', 'users.fr|fr.users.index.shown' => false, 'users.fr|fr.users.index.hidden' => true, 'users.fr|fr.users.index.what' => nil } end let(:expected_content) do { 'users.fr|fr.users.index.title' => 'Foo', 'users.fr|fr.users.index.actions___KEY___0' => 'Bar', 'users.fr|fr.users.index.actions___KEY___1' => '___TRUE___', 'users.fr|fr.users.index.actions___KEY___2' => 'LOL', 'users.fr|fr.users.index.footer' => 'Bla', 'users.fr|fr.users.index.shown' => '___FALSE___', 'users.fr|fr.users.index.hidden' => '___TRUE___', 'users.fr|fr.users.index.what' => '___NULL___' } end it { expect(flattenized_content).to eql expected_content } end end