mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 13:14:29 +08:00
Fix tests and checklist item validation [SCI-4776]
This commit is contained in:
parent
dc481cf236
commit
3af20c96c7
2 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@ class ChecklistItem < ApplicationRecord
|
|||
length: { maximum: Constants::TEXT_MAX_LENGTH }
|
||||
validates :checklist, presence: true
|
||||
validates :checked, inclusion: { in: [true, false] }
|
||||
validates :position, uniqueness: { scope: :checklist }
|
||||
validates :position, uniqueness: { scope: :checklist }, unless: -> { position.nil? }
|
||||
|
||||
belongs_to :checklist,
|
||||
inverse_of: :checklist_items
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
FactoryBot.define do
|
||||
factory :tiny_mce_asset do
|
||||
association :team, factory: :team
|
||||
image do
|
||||
fixture_file_upload(Rails.root.join('spec', 'fixtures', 'files', 'test.jpg'), 'image/jpg')
|
||||
after(:create) do |tiny_mce_asset|
|
||||
tiny_mce_asset.image.attach(io: File.open(Rails.root.join('spec/fixtures/files/test.jpg')), filename: 'test.jpg')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue