search_spec.rb 658 B

123456789101112131415
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe Service::Search do
  4. describe '#models' do
  5. let(:search) { described_class.new(current_user: create(:agent)) }
  6. let(:models_with_direct_index) { search.models(objects: Models.searchable, direct_search_index: true) }
  7. let(:models_without_direct_index) { search.models(objects: Models.searchable, direct_search_index: false) }
  8. it 'returns different models for different direct_search_index flags' do
  9. expect(models_with_direct_index).not_to be_intersect(models_without_direct_index)
  10. end
  11. end
  12. end