diff --git a/spec/lib/pg_searchable_new_spec.rb b/spec/lib/pg_searchable_new_spec.rb index 51824d3..01f9204 100644 --- a/spec/lib/pg_searchable_new_spec.rb +++ b/spec/lib/pg_searchable_new_spec.rb @@ -356,6 +356,13 @@ describe PgSearchable do it 'can search in referenced column associated with through relaction - mixed search terms with AND NOT' do expect(Player.scope_search('tag:e-ink AND NOT first')).to contain_exactly(players[1]) end + + it 'can search in referenced column and in model columns - complex search' do + expect(Player.scope_search('(tag:e-ink AND tag:rich) OR (blue or value:eagle)')).to contain_exactly(players[1], players[2], players[3]) + expect(Player.scope_search('tag:e-ink AND tag:rich AND NOT tag:black')).to be_empty + expect(Player.scope_search('name:l AND (value:uptown or value:marine) AND (tag:e-ink and tag:rich)')).to contain_exactly(players[1]) + expect(Player.scope_search('name:l AND (value:uptown or value:marine) AND (tag:e-ink and tag:led)')).to be_empty + end end end end