Updates the theme detection pattern - Ref #816
This commit is contained in:
@@ -30,7 +30,7 @@ class WpTheme < WpItem
|
|||||||
response = Browser.get_and_follow_location(target_uri.to_s)
|
response = Browser.get_and_follow_location(target_uri.to_s)
|
||||||
|
|
||||||
# https + domain is optional because of relative links
|
# 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(
|
new(
|
||||||
target_uri,
|
target_uri,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ describe 'WpTheme::Findable' do
|
|||||||
|
|
||||||
expect(wp_theme).to be_a WpTheme if @expected
|
expect(wp_theme).to be_a WpTheme if @expected
|
||||||
expect(wp_theme).to eq @expected
|
expect(wp_theme).to eq @expected
|
||||||
|
expect(wp_theme.wp_content_dir).to eql 'wp-content' if @expected
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when theme is not present' do
|
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')
|
@expected = WpTheme.new(uri, name: 'Editorial', version: '1.3.5')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '::find' do
|
describe '::find' do
|
||||||
@@ -114,7 +114,6 @@ describe 'WpTheme::Findable' do
|
|||||||
|
|
||||||
context 'when a method is named s_find_from_s' do
|
context 'when a method is named s_find_from_s' do
|
||||||
it 'does not call it' do
|
it 'does not call it' do
|
||||||
|
|
||||||
class WpTheme
|
class WpTheme
|
||||||
module Findable
|
module Findable
|
||||||
extend self
|
extend self
|
||||||
|
|||||||
Reference in New Issue
Block a user