|
@@ -0,0 +1,20 @@
|
|
|
|
+# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
|
|
|
+
|
|
|
|
+require 'rails_helper'
|
|
|
|
+
|
|
|
|
+RSpec.describe Ticket::Search do
|
|
|
|
+ describe 'Duplicate results in search #3876' do
|
|
|
|
+ let(:search) { SecureRandom.uuid }
|
|
|
|
+ let(:ticket) { create(:ticket, group: Group.first) }
|
|
|
|
+ let(:articles) { create_list(:ticket_article, 3, ticket: ticket, body: search) }
|
|
|
|
+ let(:agent) { create(:agent, groups: Group.all) }
|
|
|
|
+
|
|
|
|
+ before do
|
|
|
|
+ articles
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+ it 'does not show up the same ticket twice if no elastic search is configured' do
|
|
|
|
+ expect(Ticket.search(current_user: agent, query: search)).to eq([ticket])
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+end
|