mention_spec.rb 378 B

1234567891011
  1. require 'rails_helper'
  2. RSpec.describe Mention, type: :model do
  3. let(:ticket) { create(:ticket) }
  4. describe 'validation' do
  5. it 'does not allow mentions for customers' do
  6. expect { create(:mention, mentionable: ticket, user: create(:customer)) }.to raise_error(ActiveRecord::RecordInvalid, 'Validation failed: User has no ticket.agent permissions')
  7. end
  8. end
  9. end