Skip to content

Commit

Permalink
[deliver] fix regression where changes made to the privacy URL fail t…
Browse files Browse the repository at this point in the history
…o upload (fastlane#21657)

* fix(deliver): fix issue where privacy url change fails to upload

* fix code style

* add test
  • Loading branch information
owjsub authored and SubhrajyotiSen committed Jan 17, 2024
1 parent 91a42c8 commit 93b4c14
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deliver/lib/deliver/upload_metadata.rb
Expand Up @@ -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

Expand All @@ -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
Expand Down
25 changes: 25 additions & 0 deletions deliver/spec/upload_metadata_spec.rb
Expand Up @@ -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 = {
Expand Down

0 comments on commit 93b4c14

Please sign in to comment.