link_spec.rb 432 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Link, type: :model do
  4. subject(:link) { create(:link) }
  5. it 'can be saved' do
  6. expect(link).to be_persisted
  7. end
  8. it 'Validates link uniqueness' do
  9. link # create a matching link
  10. other = build(:link)
  11. other.save
  12. expect(other.errors.full_messages).to include('Link already exists')
  13. end
  14. end