Skip to content

Commit

Permalink
fix(CssAsset): Add rel attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
iurquiza authored and elpete committed Oct 26, 2018
1 parent c207583 commit 304e665
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion models/CssAsset.cfc
Expand Up @@ -31,7 +31,7 @@ component implements="Asset" accessors="true" {
* @returns The rendered asset.
*/
public string function toString() {
return '<link type="text/css" href="#variables.filepath#">';
return '<link type="text/css" rel="stylesheet" href="#variables.filepath#">';
}

/**
Expand Down
20 changes: 10 additions & 10 deletions tests/specs/unit/AssetBagSpec.cfc
Expand Up @@ -28,7 +28,7 @@ component extends="testbox.system.BaseSpec" {
assetBag.addCssToHead( "/includes/css/app.css" );

expect( assetBag.renderHead() ).toBe(
'<link type="text/css" href="/includes/css/app.css">'
'<link type="text/css" rel="stylesheet" href="/includes/css/app.css">'
);
expect( assetBag.renderFooter() ).toBe( "" );
} );
Expand All @@ -51,7 +51,7 @@ component extends="testbox.system.BaseSpec" {

expect( assetBag.renderHead() ).toBe( "" );
expect( assetBag.renderFooter() ).toBe(
'<link type="text/css" href="/includes/css/app.css">'
'<link type="text/css" rel="stylesheet" href="/includes/css/app.css">'
);
} );

Expand Down Expand Up @@ -79,11 +79,11 @@ component extends="testbox.system.BaseSpec" {
assetBag.addCssToFooter( "/includes/css/app3.css" );

expect( assetBag.renderHead() ).toBe( arrayToList( [
'<link type="text/css" href="/includes/css/app1.css">'
'<link type="text/css" rel="stylesheet" href="/includes/css/app1.css">'
], chr( 10 ) ) );
expect( assetBag.renderFooter() ).toBe( arrayToList( [
'<link type="text/css" href="/includes/css/app2.css">',
'<link type="text/css" href="/includes/css/app3.css">'
'<link type="text/css" rel="stylesheet" href="/includes/css/app2.css">',
'<link type="text/css" rel="stylesheet" href="/includes/css/app3.css">'
], chr( 10 ) ) );
} );

Expand All @@ -97,11 +97,11 @@ component extends="testbox.system.BaseSpec" {
assetBag.addCssToFooter( "/includes/css/app2.css" );

expect( assetBag.renderHead() ).toBe( arrayToList( [
'<link type="text/css" href="/includes/css/app1.css">',
'<link type="text/css" rel="stylesheet" href="/includes/css/app1.css">',
'<script type="text/javascript" src="/includes/js/app1.js"></script>'
], chr( 10 ) ) );
expect( assetBag.renderFooter() ).toBe( arrayToList( [
'<link type="text/css" href="/includes/css/app2.css">',
'<link type="text/css" rel="stylesheet" href="/includes/css/app2.css">',
'<script type="text/javascript" src="/includes/js/app2.js"></script>'
], chr( 10 ) ) );
} );
Expand Down Expand Up @@ -154,7 +154,7 @@ component extends="testbox.system.BaseSpec" {

expect( assetBag.renderHead() ).toBe( "" );
expect( assetBag.renderFooter() ).toBe(
'<link type="text/css" href="/includes/css/app.css">'
'<link type="text/css" rel="stylesheet" href="/includes/css/app.css">'
);
} );

Expand Down Expand Up @@ -194,8 +194,8 @@ component extends="testbox.system.BaseSpec" {
assetBag.addJavascriptToFooter( "/includes/js/app2.js" ).setPriority( 1 );

expect( assetBag.renderHead() ).toBe( arrayToList( [
'<link type="text/css" href="/includes/css/app2.css">',
'<link type="text/css" href="/includes/css/app1.css">'
'<link type="text/css" rel="stylesheet" href="/includes/css/app2.css">',
'<link type="text/css" rel="stylesheet" href="/includes/css/app1.css">'
], chr( 10 ) ) );
expect( assetBag.renderFooter() ).toBe( arrayToList( [
'<script type="text/javascript" src="/includes/js/app2.js"></script>',
Expand Down

0 comments on commit 304e665

Please sign in to comment.