add more search tests

This commit is contained in:
Bilal
2020-04-29 18:00:58 +02:00
parent c7b173cb79
commit 3c4f3f3b58

View File

@@ -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