mention_spec.rb 455 B

12345678910111213
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Mention, type: :model do
  4. let(:ticket) { create(:ticket) }
  5. describe 'validation' do
  6. it 'does not allow mentions for customers' do
  7. expect { create(:mention, mentionable: ticket, user: create(:customer)) }.to raise_error(ActiveRecord::RecordInvalid, 'Validation failed: User has no ticket.agent permissions')
  8. end
  9. end
  10. end