aboutsummaryrefslogtreecommitdiff
path: root/spec/lib/messages_spec.rb
diff options
context:
space:
mode:
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