diff --git a/spec/fixtures/vcr_cassettes/import.yml b/spec/fixtures/vcr_cassettes/import.yml index d36431d..273c335 100644 --- a/spec/fixtures/vcr_cassettes/import.yml +++ b/spec/fixtures/vcr_cassettes/import.yml @@ -5,31 +5,31 @@ http_interactions: uri: https://api.lokalise.com/api2/projects/672198945b7d72fc048021.15940510/files/download body: encoding: UTF-8 - string: '{"format":"yaml","placeholder_format":"icu","yaml_include_root":true,"original_filenames":true,"directory_prefix":"","indentation":"2sp"}' + string: '{"format":"ruby_yaml","placeholder_format":"icu","yaml_include_root":true,"original_filenames":true,"directory_prefix":"","indentation":"2sp"}' headers: Accept: - application/json User-Agent: - - ruby-lokalise-api gem/4.5.1 - x-api-token: - - "" + - ruby-lokalise-api gem/6.2.0 Accept-Encoding: - gzip,deflate,br + x-api-token: + - "" response: status: code: 200 message: OK headers: - server: - - nginx date: - - Thu, 27 Jan 2022 16:55:41 GMT + - Wed, 17 Aug 2022 17:25:41 GMT content-type: - application/json transfer-encoding: - chunked connection: - keep-alive + server: + - nginx vary: - Accept-Encoding cache-control: @@ -47,9 +47,14 @@ http_interactions: referrer-policy: - origin x-lokalise-process-id: - - e0feae32-9fa8-463e-8463-26304811343d + - 68f6867f-5c73-4ae9-8aac-e2e0b85bba67 expires: - - Thu, 27 Jan 2022 16:55:41 GMT + - Wed, 17 Aug 2022 17:25:41 GMT + x-debug-token: + - c7e167 + set-cookie: + - PHPSESSID=deleted; expires=Tue, 17-Aug-2021 17:25:40 GMT; Max-Age=0; path=/; + httponly access-control-allow-origin: - "*" access-control-allow-headers: @@ -59,6 +64,6 @@ http_interactions: body: encoding: ASCII-8BIT string: !binary |- - H4sIAAAAAAAEA4WPS27DIBRF98K45meMccZdQJUxkvWCHwotNhYPK1Gq7r3uCjo60tEZ3PvN9lo+MbQ5LezC7KjV5CYz3MZl1DFI46RWXA2TkYOS7I3dKmzhfqYrUMP6Z45tyTgfNZ/23tpOFy+8oJ7j0T2QWqc4rPAqGzyIh7J6kcsX5ETYARE28iKmjCfwuZfavPhnhhcSwfSjdRKDxuBc1BECxl7ZMNlgrBfvuJb5CinT/HE+7HIJkJG/0s5+fgHytEpI9QAAAA== - recorded_at: Thu, 27 Jan 2022 16:55:41 GMT -recorded_with: VCR 6.0.0 + H4sIAAAAAAAEA4WPQW7DIBRE78K6GJsYCFnnAFXXSNY3fBQabBDgpErVu5eeoJsZ6WmkmfkmuaRPtG0JjlyIVHzSZz2LVTnFvR3n88inYRJ6HsU0kjeyFtjtrUc3qA3LHzl2F3E5Suz01lquF8MMq6cBD2pxbwUinQbY4JV2eNbBps2wmO4QQ0Uaw6NLulPImW4Qdgq1YquG+RCxG37lVJph/2wzbPZKz06AkCfOwaFC54VHuWrupZLCsCtuafmAEOvy3m/3WgsRh1fI5OcXTwPRpgoBAAA= + recorded_at: Wed, 17 Aug 2022 17:25:41 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/lib/lokalise_manager/task_definitions/importer_spec.rb b/spec/lib/lokalise_manager/task_definitions/importer_spec.rb index c50977c..9738182 100644 --- a/spec/lib/lokalise_manager/task_definitions/importer_spec.rb +++ b/spec/lib/lokalise_manager/task_definitions/importer_spec.rb @@ -115,9 +115,14 @@ expect(result).to be true - expect(count_translations).to eq(24) - expect_file_exist loc_path, 'en_1.yml' - expect_file_exist loc_path, 'ru_2.yml' + expect(count_translations).to eq(5) + expect_file_exist loc_path, 'en.yaml' + expect_file_exist loc_path, 'fr.yaml' + + trans_data = YAML.load_file(File.join(loc_path, 'en.yaml')) + # rubocop:disable Style/FormatStringToken + expect(trans_data['en']['welcome']).to eq('Welcome to the app, %{username}') + # rubocop:enable Style/FormatStringToken end it 'runs import successfully but does not provide any output when silent_mode is enabled' do @@ -129,8 +134,8 @@ end expect(result).to be true - expect_file_exist loc_path, 'en_1.yml' - expect_file_exist loc_path, 'ru_2.yml' + expect_file_exist loc_path, 'en.yaml' + expect_file_exist loc_path, 'fr.yaml' expect(described_object.config).to have_received(:silent_mode).at_most(1).times end end