Skip to content

Commit 3627684

Browse files
committed
feat: Update specs for AppStoreSubmission#prepare_for_release!
1 parent ca63dd8 commit 3627684

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

app/models/release_metadata.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class ReleaseMetadata < ApplicationRecord
4545
if: :android?
4646
validates :promo_text,
4747
format: {with: IOS_PLAINTEXT_REGEX, message: :no_special_characters, allow_blank: true, denied_characters: IOS_DENY_LIST.join(", "), multiline: true},
48-
length: {maximum: PROMO_TEXT_MAX_LENGTH}
48+
length: {maximum: PROMO_TEXT_MAX_LENGTH},
49+
if: :ios?
4950
validates :description, length: {maximum: IOS_DESCRIPTION_MAX_LENGTH}, if: :ios?
5051
validate :keywords_length, if: :ios?
5152
validates :locale, uniqueness: {scope: :release_platform_run_id}

spec/models/app_store_submission_spec.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,33 @@
3232

3333
before do
3434
allow(providable_dbl).to receive(:prepare_release).and_return(GitHub::Result.new { prepared_release_info })
35+
submission.release_platform_run
36+
.default_release_metadata
37+
.update!(release_notes: "Bug fixes and stability improvements",
38+
promo_text: "Try the new feature",
39+
description: "A longer store description",
40+
keywords: ["bugfix", "performance"])
3541
end
3642

3743
it "prepares the release" do
3844
submission.prepare_for_release!
3945

40-
expect(providable_dbl).to have_received(:prepare_release).with(build.build_number, build.version_name, true, anything, true, false).once
46+
expect(providable_dbl).to have_received(:prepare_release).with(
47+
build.build_number,
48+
build.version_name,
49+
true,
50+
[
51+
{
52+
whats_new: "Bug fixes and stability improvements",
53+
promotional_text: "Try the new feature",
54+
description: "A longer store description",
55+
keywords: "bugfix,performance",
56+
locale: "en-US"
57+
}
58+
],
59+
true,
60+
false
61+
).once
4162
end
4263

4364
it "marks the submission as prepared" do

0 commit comments

Comments
 (0)