Skip to content

Commit

Permalink
Updates the theme detection pattern - Ref #816
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanlr committed May 1, 2015
1 parent e6751e0 commit 227a39d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/common/models/wp_theme/findable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def find_from_css_link(target_uri)
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,
Expand Down
3 changes: 1 addition & 2 deletions spec/lib/common/models/wp_theme/findable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

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
Expand Down Expand Up @@ -101,7 +102,6 @@
@expected = WpTheme.new(uri, name: 'Editorial', version: '1.3.5')
end
end

end

describe '::find' do
Expand All @@ -114,7 +114,6 @@ def stub_all_to_nil

context 'when a method is named s_find_from_s' do
it 'does not call it' do

class WpTheme
module Findable
extend self
Expand Down

0 comments on commit 227a39d

Please sign in to comment.