aboutsummaryrefslogtreecommitdiff
path: root/spec/lib/messages_spec.rb
diff options
context:
space:
mode:
authormms <git@sapka.me>2024-11-22 23:35:51 +0100
committermms <git@sapka.me>2024-11-22 23:37:42 +0100
commitc2623f1aa3638c988026b28f6a4131df6c61e0c6 (patch)
treec9a685d2997214bcb90f3659febc56f7ac85cbbb /spec/lib/messages_spec.rb
parent64ab548e16fdc8fa862e2b432464f3d67f5d9db8 (diff)
feat: allow to search for thread
Diffstat (limited to 'spec/lib/messages_spec.rb')
-rw-r--r--spec/lib/messages_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/lib/messages_spec.rb b/spec/lib/messages_spec.rb
index 79551b7..4abc2c6 100644
--- a/spec/lib/messages_spec.rb
+++ b/spec/lib/messages_spec.rb
@@ -4,7 +4,7 @@ require 'rspec'
require_relative '../../lib/chotto/messages'
RSpec.describe Chotto::Messages do
- let(:subject) { Chotto::Messages.new(db: double('Notmuch')) }
+ let(:subject) { Chotto::Messages.new(db: double('Notmuch'), only_new: false) }
describe 'direct filters' do
it { expect(subject.filter('from:baltar@battlestar.com').query_string).to eq(' (from:baltar@battlestar.com)') }
@@ -74,4 +74,13 @@ RSpec.describe Chotto::Messages do
it { expect(subject.filter('from:baltar@battlestar.com').newest_first.order).to eq('newest_first') }
it { expect(subject.filter('from:baltar@battlestar.com').newest_first.oldest_first.order).to eq('oldest_first') }
end
+
+ context 'with only_new' do
+ let(:subject) { Chotto::Messages.new(db: double('Notmuch'), only_new: true) }
+
+ it 'prepends the filter with tag:new' do
+ expect(subject.filter('from:baltar@battlestar.com').query_string)
+ .to eq('tag:new AND ( (from:baltar@battlestar.com))')
+ end
+ end
end