spec/lita/handlers/web_title_spec.rb in lita-web-title-1.0.5 vs spec/lita/handlers/web_title_spec.rb in lita-web-title-1.0.6

- old
+ new

@@ -1,8 +1,14 @@ require 'spec_helper' describe Lita::Handlers::WebTitle, lita_handler: true do + before :each do + registry.config.handlers.web_title.tap do |config| + config.ignore_patterns = ["example.com","github.com"] + end + end + let(:robot) { Lita::Robot.new(registry) } subject(:handler) { described_class.new(robot) } describe 'routing' do it { is_expected.to route('I like http://github.com/').to(:parse_uri_request) } @@ -22,10 +28,16 @@ it 'returns nothing for URLs that are not HTML' do send_command('This is the logo https://www.google.com/images/srpr/logo11w.png') expect(replies.last).to be_nil end - end + + it 'ignores example.com links' do + send_command('I hate http://www.example.com/') + expect(replies.last).to be_nil + end + + end describe '.parse_uri' do it 'returns the title' do expect(handler.parse_uri('https://google.com/')) .to match(/Google/)