diff --git a/lib/common/models/wp_theme/findable.rb b/lib/common/models/wp_theme/findable.rb index cdd13b45..d3aec6a7 100755 --- a/lib/common/models/wp_theme/findable.rb +++ b/lib/common/models/wp_theme/findable.rb @@ -30,7 +30,7 @@ class WpTheme < WpItem response = Browser.get_and_follow_location(target_uri.to_s) # https + domain is optional because of relative links - return unless response.body =~ %r{(?:https?://[^"']+)?/?([^/\s]+)/themes/([^"'/]+)[^"']*/style.css}i + return unless response.body =~ %r{(?:https?://[^"']+/)?([^/\s]+)/themes/([^"'/]+)[^"']*/style.css}i new( target_uri, diff --git a/spec/lib/common/models/wp_theme/findable_spec.rb b/spec/lib/common/models/wp_theme/findable_spec.rb index 113ffa1c..cf294893 100644 --- a/spec/lib/common/models/wp_theme/findable_spec.rb +++ b/spec/lib/common/models/wp_theme/findable_spec.rb @@ -19,6 +19,7 @@ describe 'WpTheme::Findable' do expect(wp_theme).to be_a WpTheme if @expected expect(wp_theme).to eq @expected + expect(wp_theme.wp_content_dir).to eql 'wp-content' if @expected end context 'when theme is not present' do @@ -101,7 +102,6 @@ describe 'WpTheme::Findable' do @expected = WpTheme.new(uri, name: 'Editorial', version: '1.3.5') end end - end describe '::find' do @@ -114,7 +114,6 @@ describe 'WpTheme::Findable' do context 'when a method is named s_find_from_s' do it 'does not call it' do - class WpTheme module Findable extend self