1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

Merge pull request #886 from pwnall/font_paths

More font paths test coverage.
This commit is contained in:
Thomas Reynolds 2013-05-06 09:33:20 -07:00
commit 27a9fa98f7
5 changed files with 53 additions and 15 deletions

View file

@ -6,8 +6,10 @@ Feature: Web Fonts
Then the following files should exist:
| stylesheets/fonts.css |
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
Given the Server is running at "fonts-app"
When I go to "/stylesheets/fonts.css"
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"
When I go to "/stylesheets/fonts.css"
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
Given a fixture app "relative-assets-app"

View file

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