Fixed false positive theme detection
This commit is contained in:
@@ -52,6 +52,13 @@ describe 'WpTheme::Findable' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when other style.css is referenced' do
|
||||
it 'returns the WpTheme' do
|
||||
@file = 'yootheme.html'
|
||||
@expected = WpTheme.new(uri, name: 'yoo_solar_wp')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe '::find_from_wooframework' do
|
||||
|
||||
@@ -29,24 +29,11 @@ describe WpTheme do
|
||||
let(:theme_path) { 'wp-content/themes/theme-name/' }
|
||||
|
||||
describe '#allowed_options' do
|
||||
its(:allowed_options) { is_expected.to include :style_url }
|
||||
its(:allowed_options) { is_expected.to include :additional_url }
|
||||
end
|
||||
|
||||
describe '#forge_uri' do
|
||||
its(:uri) { is_expected.to eq uri.merge(theme_path) }
|
||||
end
|
||||
|
||||
describe '#style_url' do
|
||||
its(:style_url) { is_expected.to eq uri.merge(theme_path + '/style.css').to_s }
|
||||
|
||||
context 'when its already set' do
|
||||
it 'returns it instead of the default one' do
|
||||
url = uri.merge(theme_path + '/custom.css').to_s
|
||||
wp_theme.style_url = url
|
||||
|
||||
expect(wp_theme.style_url).to eq url
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="de-DE" dir="ltr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>XXXXX </title>
|
||||
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://domain.com/xmlrpc.php?rsd" />
|
||||
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://domain.com/wp-includes/wlwmanifest.xml" />
|
||||
<meta name="generator" content="WordPress 3.9.1" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/base.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/layout.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/menus.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/modules.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/tools.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/system.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/extensions.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/custom.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/animation.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/texture/noise.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/color/green.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/font1/droidsans.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/font2/droidsans.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/font3/droidsans.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/styles/wood/css/style.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/responsive.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/css/print.css" />
|
||||
<link rel="stylesheet" href="/wp-content/themes/yoo_solar_wp/fonts/droidsans.css" />
|
||||
<script src="/wp-content/themes/yoo_solar_wp/warp/js/warp.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body></body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user