More font paths test coverage.

Specifically, the new cases check the correctness of paths generated by
font_files / font_url when relative_assets is on in build mode, and when
a custom fonts_dir is specified in preview mode.
This commit is contained in:
Victor Costan 2013-05-05 21:39:50 -04:00
parent c474e2b410
commit c0e1bf06bf
5 changed files with 53 additions and 15 deletions

View file

@ -6,8 +6,10 @@ Feature: Web Fonts
Then the following files should exist: Then the following files should exist:
| stylesheets/fonts.css | | stylesheets/fonts.css |
And the file "stylesheets/fonts.css" should contain "/fonts/StMarie-Thin.otf" And the file "stylesheets/fonts.css" should contain "/fonts/StMarie-Thin.otf"
And the file "stylesheets/fonts.css" should contain "/fonts/blank/blank.otf"
Scenario: Rendering scss Scenario: Rendering scss
Given the Server is running at "fonts-app" Given the Server is running at "fonts-app"
When I go to "/stylesheets/fonts.css" When I go to "/stylesheets/fonts.css"
Then I should see "/fonts/StMarie-Thin.otf" Then I should see "/fonts/StMarie-Thin.otf"
And I should see "/fonts/blank/blank.otf"

View file

@ -89,6 +89,40 @@ Feature: Relative Assets
And the Server is running at "fonts-app" And the Server is running at "fonts-app"
When I go to "/stylesheets/fonts.css" When I go to "/stylesheets/fonts.css"
Then I should see "url('../fonts/StMarie-Thin.otf" Then I should see "url('../fonts/StMarie-Thin.otf"
And I should see "url('../fonts/blank/blank.otf"
Scenario: Rendering scss with the feature enabled and a custom fonts_dir
Given "relative_assets" feature is "enabled"
And "fonts_dir" is set to "otf"
And the Server is running at "fonts-app"
When I go to "/stylesheets/fonts.css"
Then I should not see "url('../fonts/StMarie-Thin.otf"
And I should see "url('../otf/StMarie-Thin.otf"
And I should see "url('../otf/blank/blank.otf"
Scenario: Building scss with the feature enabled
Given a fixture app "fonts-app"
And a file named "config.rb" with:
"""
activate :relative_assets
"""
Given a successfully built app at "fonts-app"
When I cd to "build"
Then the file "stylesheets/fonts.css" should contain "url('../fonts/StMarie-Thin.otf')"
And the file "stylesheets/fonts.css" should contain "url('../fonts/blank/blank.otf')"
Scenario: Building scss with the feature enabled and a custom fonts_dir
Given a fixture app "fonts-app"
And a file named "config.rb" with:
"""
set :fonts_dir, "otf"
activate :relative_assets
"""
Given a successfully built app at "fonts-app"
When I cd to "build"
Then the file "stylesheets/fonts.css" should not contain "url('../fonts/StMarie-Thin.otf')"
And the file "stylesheets/fonts.css" should contain "url('../otf/StMarie-Thin.otf')"
And the file "stylesheets/fonts.css" should contain "url('../otf/blank/blank.otf')"
Scenario: Relative assets via image_tag Scenario: Relative assets via image_tag
Given a fixture app "relative-assets-app" Given a fixture app "relative-assets-app"

View file

@ -1,3 +1,5 @@
@import "compass/css3/font-face" @import "compass/css3/font-face"
+font-face("St Marie", font-files("StMarie-Thin.otf", opentype)) +font-face("St Marie", font-files("StMarie-Thin.otf", opentype))
+font-face("St Marie", font-files("blank/blank.otf", opentype))