aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormms <git@sapka.me>2024-11-07 23:17:14 +0100
committermms <git@sapka.me>2024-11-07 23:17:14 +0100
commiteb09313a38aecf7e7cc5292a2fd1c7845609ff1c (patch)
tree25705fc18c2e52eaad0e53d83ce1ee9bdb87949a /spec
parenteb327b3b8ccde4f0a682a0167af8fc4ab89d3958 (diff)
feat: hash filters
Diffstat (limited to 'spec')
-rw-r--r--spec/messages_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/messages_spec.rb b/spec/messages_spec.rb
index 5998fd1..de8b393 100644
--- a/spec/messages_spec.rb
+++ b/spec/messages_spec.rb
@@ -35,4 +35,22 @@ RSpec.describe Some::Messages do
.to eq(' (from:baltar@battlestar.com) or (ship:galactica) and (hair:long)')
}
end
+
+ describe 'hash filters' do
+ context 'with singular values' do
+ it { expect(subject.filter(from: 'baltar@battlestar.com').query_string).to eq('( (from:baltar@battlestar.com))') }
+
+ it {
+ expect(subject.filter(from: 'baltar@battlestar.com', ship: 'galactica').query_string)
+ .to eq('( (from:baltar@battlestar.com) and (ship:galactica))')
+ }
+ end
+
+ context 'with set of values' do
+ it {
+ expect(subject.filter(from: ['baltar@battlestar.com',
+ 'adama@battestar.com']).query_string).to eq('(( (from:baltar@battlestar.com) or (from:adama@battestar.com)))')
+ }
+ end
+ end
end