search_spec.rb 649 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Ticket::Search do
  4. describe 'Duplicate results in search #3876' do
  5. let(:search) { SecureRandom.uuid }
  6. let(:ticket) { create(:ticket, group: Group.first) }
  7. let(:articles) { create_list(:ticket_article, 3, ticket: ticket, body: search) }
  8. let(:agent) { create(:agent, groups: Group.all) }
  9. before do
  10. articles
  11. end
  12. it 'does not show up the same ticket twice if no elastic search is configured' do
  13. expect(Ticket.search(current_user: agent, query: search)).to eq([ticket])
  14. end
  15. end
  16. end