Skip to content

Commit

Permalink
Search for searchable attrs of this wagon
Browse files Browse the repository at this point in the history
  • Loading branch information
kronn committed Nov 8, 2024
1 parent 92961b7 commit 81bdf59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ spec/coverage
spec/reports
brakeman-output.tabs
rubocop-results.xml
coverage/
31 changes: 5 additions & 26 deletions spec/domain/search_strategies/person_search_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Copyright (c) 2021, Die Mitte. This file is part of
# Copyright (c) 2021-2024, Die Mitte. This file is part of
# hitobito_die_mitte and licensed under the Affero General Public License version 3
# or later. See the COPYING file at the top-level directory or at
# https://github.com/hitobito/hitobito_die_mitte.
Expand All @@ -11,32 +11,11 @@
describe "#search_fulltext" do
let(:user) { people(:admin) }

it "finds accessible person by title" do
result = search_class(people(:admin).title.to_s).search_fulltext
it "finds accessible person by role-label" do
search_term = 'Admingott'

expect(result).to include(people(:admin))
end

it "finds accessible person by website" do
result = search_class(people(:admin).website.to_s).search_fulltext

expect(result).to include(people(:admin))
end

it "finds accessible person by correspondence_language" do
result = search_class(people(:admin).correspondence_language.to_s).search_fulltext

expect(result).to include(people(:admin))
end

it "finds accessible person by civil_status" do
result = search_class(people(:admin).civil_status.to_s).search_fulltext

expect(result).to include(people(:admin))
end

it "finds accessible person by salutation" do
result = search_class(people(:admin).salutation.to_s).search_fulltext
user.roles << Group::BundSekretariat::ItSupport.new(group: groups(:sekretariat), label: search_term)
result = search_class(search_term).search_fulltext

expect(result).to include(people(:admin))
end
Expand Down

0 comments on commit 81bdf59

Please sign in to comment.