checklist_template_spec.rb 606 B

1234567891011121314
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe ChecklistTemplate, :aggregate_failures, type: :model do
  4. describe 'validations' do
  5. context 'when limits are reached' do
  6. it 'does not allow more than 100 items' do
  7. checklist = create(:checklist_template, item_count: 100)
  8. expect { checklist.items.create!(text: 'new', created_by_id: 1, updated_by_id: 1) }.to raise_error(ActiveRecord::RecordInvalid, 'Validation failed: Checklist Template items are limited to 100 items per checklist.')
  9. end
  10. end
  11. end
  12. end