diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/chotto_spec.rb | 6 | ||||
-rw-r--r-- | spec/lib/helpers_spec.rb | 8 | ||||
-rw-r--r-- | spec/lib/message_spec.rb | 3 |
3 files changed, 7 insertions, 10 deletions
diff --git a/spec/chotto_spec.rb b/spec/chotto_spec.rb index 7593a48..019c0e4 100644 --- a/spec/chotto_spec.rb +++ b/spec/chotto_spec.rb @@ -35,8 +35,7 @@ describe Chotto do end it 'sends the rules to Notmuch - scenario 1' do - expect(message_double).to receive(:tags) - expect(message_double).to receive(:header).with('Subject').and_return('Number Six') + expect(message_double).to receive(:header).with('subject').and_return('Number Six') expect(message_double).to receive(:remove_all_tags) expect(message_double).to receive(:add_tag).with('todo') expect(db_instance_double).to receive(:close) @@ -45,8 +44,7 @@ describe Chotto do end it 'sends the rules to Notmuch - scenario 2' do - expect(message_double).to receive(:tags) - expect(message_double).to receive(:header).with('Subject').and_return('Boomer') + expect(message_double).to receive(:header).with('subject').and_return('Boomer') expect(message_double).to receive(:remove_all_tags) expect(message_double).to receive(:add_tag).with('spam') expect(db_instance_double).to receive(:close) diff --git a/spec/lib/helpers_spec.rb b/spec/lib/helpers_spec.rb index 5b841e4..c2f21f3 100644 --- a/spec/lib/helpers_spec.rb +++ b/spec/lib/helpers_spec.rb @@ -6,10 +6,10 @@ require_relative '../../lib/chotto/helpers' RSpec.describe Chotto::Helpers do let(:subject) { Chotto::Helpers } describe '#header_name_from_dsl' do - it { expect(subject.header_name_from_dsl('word')).to eq('Word') } - it { expect(subject.header_name_from_dsl('wOrd')).to eq('Word') } - it { expect(subject.header_name_from_dsl('Word')).to eq('Word') } + it { expect(subject.header_name_from_dsl('word')).to eq('word') } + it { expect(subject.header_name_from_dsl('wOrd')).to eq('word') } + it { expect(subject.header_name_from_dsl('Word')).to eq('word') } - it { expect(subject.header_name_from_dsl('many_words')).to eq('Many-Words') } + it { expect(subject.header_name_from_dsl('many_words')).to eq('many-words') } end end diff --git a/spec/lib/message_spec.rb b/spec/lib/message_spec.rb index 8994216..375b611 100644 --- a/spec/lib/message_spec.rb +++ b/spec/lib/message_spec.rb @@ -12,7 +12,7 @@ RSpec.describe Chotto::Message do let(:subject) { Chotto::Message.new(msg: msg, db: db_double) } it 'reads headers' do - expect(msg).to receive(:header).with('A-Header') + expect(msg).to receive(:header).with('a-header') subject.a_header end @@ -53,7 +53,6 @@ RSpec.describe Chotto::Message do it 'fetches messages for thread' do expect(msg).to receive(:thread_id).and_return(thread_id) expect(db_double).to receive(:search_messages).with("thread:#{thread_id}").and_return([msg_in_thread]) - expect(msg_in_thread).to receive(:tags) expect(tester).to receive(:test).with(an_instance_of(Chotto::Message)) |