Change MAX_TAG_LIST_SIZE for billboards to 25 (#19981)

This commit is contained in:
Ben Halpern 2023-08-23 12:35:07 -04:00 committed by GitHub
parent 9309f27164
commit 98cccdf0ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@ class DisplayAd < ApplicationRecord
HOME_FEED_PLACEMENTS = %w[feed_first feed_second feed_third].freeze
MAX_TAG_LIST_SIZE = 10
MAX_TAG_LIST_SIZE = 25
POST_WIDTH = 775
SIDEBAR_WIDTH = 350
LOW_IMPRESSION_COUNT = 1_000

View file

@ -245,12 +245,12 @@ RSpec.describe DisplayAd do
describe ".validate_tag" do
it "rejects more than 10 tags" do
eleven_tags = "one, two, three, four, five, six, seven, eight, nine, ten, eleven"
twenty_six_tags = Array.new(26) { SecureRandom.alphanumeric(8) }.join(", ")
expect(build(:billboard,
name: "This is a billboard",
body_markdown: "Billboard Body",
placement_area: "post_comments",
tag_list: eleven_tags).valid?).to be(false)
tag_list: twenty_six_tags).valid?).to be(false)
end
it "rejects tags with length > 30" do