TagName サニタイズ(#281) (#289)
#281 #281 Merge remote-tracking branch 'origin/main' into feature/281 #281 #281 テストまだ通ってないので要確認 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #289
This commit was merged in pull request #289.
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
FactoryBot.define do
|
||||
factory :tag do
|
||||
transient do
|
||||
name { nil }
|
||||
end
|
||||
|
||||
category { :general }
|
||||
post_count { 0 }
|
||||
association :tag_name
|
||||
|
||||
after(:build) do |tag, evaluator|
|
||||
tag.name = evaluator.name if evaluator.name.present?
|
||||
end
|
||||
|
||||
trait :nico do
|
||||
category { :nico }
|
||||
tag_name { association(:tag_name, name: "nico:#{ SecureRandom.hex(4) }") }
|
||||
transient do
|
||||
name { "nico:#{ SecureRandom.hex(4) }" }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user