diff --git a/deliver/lib/deliver/upload_metadata.rb b/deliver/lib/deliver/upload_metadata.rb index 2894495a7a1..360ca2d00fe 100644 --- a/deliver/lib/deliver/upload_metadata.rb +++ b/deliver/lib/deliver/upload_metadata.rb @@ -468,7 +468,7 @@ def updating_localized_app_info?(options, app, app_info) end localizations = app_info.get_app_info_localizations - LOCALISED_APP_VALUES.keys.each do |key| + LOCALISED_APP_VALUES.each do |key, localized_key| current = options[key] next unless current @@ -485,7 +485,7 @@ def updating_localized_app_info?(options, app, app_info) next if app_info_locale.nil? begin - current_value = app_info_locale.public_send(key.to_sym) + current_value = app_info_locale.public_send(localized_key.to_sym) rescue NoMethodError next end diff --git a/deliver/spec/upload_metadata_spec.rb b/deliver/spec/upload_metadata_spec.rb index c2b3bac9b25..d1f3eda30e5 100644 --- a/deliver/spec/upload_metadata_spec.rb +++ b/deliver/spec/upload_metadata_spec.rb @@ -289,6 +289,31 @@ def create_metadata(path, text) end end + context "with privacy_url" do + it 'saves privacy_url' do + options = { + platform: "ios", + metadata_path: metadata_path, + privacy_url: { "en-US" => "https://fastlane.tools" }, + apple_tv_privacy_policy: { "en-US" => "https://fastlane.tools/tv" } + } + + # Get number of versions (used for if whats_new should be sent) + expect(Spaceship::ConnectAPI).to receive(:get_app_store_versions).and_return(app_store_versions) + + expect(version).to receive(:update).with(attributes: {}) + + # Validate symbol names used when comparing privacy urls before upload + expect(app_info_localization_en).to receive(:privacy_policy_url).and_return(options[:privacy_url]["en-US"]) + expect(app_info_localization_en).to receive(:privacy_policy_text).and_return(options[:apple_tv_privacy_policy]["en-US"]) + + # Update app info + expect(app_info).to receive(:update_categories).with(category_id_map: {}) + + uploader.upload(options) + end + end + context "with auto_release_date" do it 'with date' do options = {