diff options
Diffstat (limited to 'spec/messages_spec.rb')
-rw-r--r-- | spec/messages_spec.rb | 18 |
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 |