diff --git a/middleman-more/features/fonts.feature b/middleman-more/features/fonts.feature index b839a346..7cc9f8a1 100644 --- a/middleman-more/features/fonts.feature +++ b/middleman-more/features/fonts.feature @@ -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" \ No newline at end of file + Then I should see "/fonts/StMarie-Thin.otf" + And I should see "/fonts/blank/blank.otf" diff --git a/middleman-more/features/relative_assets.feature b/middleman-more/features/relative_assets.feature index 1a18d905..2a74159f 100644 --- a/middleman-more/features/relative_assets.feature +++ b/middleman-more/features/relative_assets.feature @@ -1,13 +1,13 @@ Feature: Relative Assets In order easily switch between relative and absolute paths - + Scenario: Previewing css with the feature disabled Given "relative_assets" feature is "disabled" And the Server is running at "relative-assets-app" When I go to "/stylesheets/relative_assets.css" Then I should not see "url('../" And I should see "/images/blank.gif')" - + Scenario: Building css with the feature disabled Given a fixture app "relative-assets-app" And a file named "config.rb" with: @@ -16,7 +16,7 @@ Feature: Relative Assets Given a successfully built app at "relative-assets-app" When I cd to "build" Then the file "stylesheets/relative_assets.css" should contain "url('/images/blank.gif')" - + Scenario: Rendering html with the feature disabled Given "relative_assets" feature is "disabled" And the Server is running at "relative-assets-app" @@ -28,7 +28,7 @@ Feature: Relative Assets And the Server is running at "relative-assets-app" When I go to "/stylesheets/relative_assets.css" Then I should see "url('../images/blank.gif" - + Scenario: Building css with the feature enabled Given a fixture app "relative-assets-app" And a file named "config.rb" with: @@ -38,7 +38,7 @@ Feature: Relative Assets Given a successfully built app at "relative-assets-app" When I cd to "build" Then the file "stylesheets/relative_assets.css" should contain "url('../images/blank.gif')" - + Scenario: Relative css reference with directory indexes Given a fixture app "relative-assets-app" And a file named "config.rb" with: @@ -49,21 +49,21 @@ Feature: Relative Assets Given a successfully built app at "relative-assets-app" When I cd to "build" Then the file "relative_image/index.html" should contain "../stylesheets/relative_assets.css" - + Scenario: Rendering html with the feature enabled Given "relative_assets" feature is "enabled" And the Server is running at "relative-assets-app" When I go to "/relative_image.html" Then I should not see "/images/blank.gif" And I should see "images/blank.gif" - + Scenario: Rendering css with a custom images_dir Given "relative_assets" feature is "enabled" And "images_dir" is set to "img" And the Server is running at "relative-assets-app" When I go to "/stylesheets/relative_assets.css" Then I should see "url('../img/blank.gif')" - + Scenario: Building css with a custom images_dir Given a fixture app "relative-assets-app" And a file named "config.rb" with: @@ -74,7 +74,7 @@ Feature: Relative Assets Given a successfully built app at "relative-assets-app" When I cd to "build" Then the file "stylesheets/relative_assets.css" should contain "url('../img/blank.gif')" - + Scenario: Rendering html with a custom images_dir Given "relative_assets" feature is "enabled" And "images_dir" is set to "img" @@ -83,12 +83,46 @@ Feature: Relative Assets Then I should not see "/images/blank.gif" Then I should not see "/img/blank.gif" And I should see "img/blank.gif" - + Scenario: Rendering scss with the feature enabled Given "relative_assets" feature is "enabled" 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" @@ -99,4 +133,4 @@ Feature: Relative Assets """ And the Server is running at "relative-assets-app" When I go to "/sub/image_tag.html" - Then I should see '' \ No newline at end of file + Then I should see '' diff --git a/middleman-more/fixtures/fonts-app/source/fonts/blank/blank.otf b/middleman-more/fixtures/fonts-app/source/fonts/blank/blank.otf new file mode 100644 index 00000000..e69de29b diff --git a/middleman-more/fixtures/fonts-app/source/stylesheets/fonts.css.sass b/middleman-more/fixtures/fonts-app/source/stylesheets/fonts.css.sass index 03d006c7..dd1aea7e 100644 --- a/middleman-more/fixtures/fonts-app/source/stylesheets/fonts.css.sass +++ b/middleman-more/fixtures/fonts-app/source/stylesheets/fonts.css.sass @@ -1,3 +1,5 @@ @import "compass/css3/font-face" -+font-face("St Marie", font-files("StMarie-Thin.otf", opentype)) \ No newline at end of file ++font-face("St Marie", font-files("StMarie-Thin.otf", opentype)) ++font-face("St Marie", font-files("blank/blank.otf", opentype)) + diff --git a/middleman-more/fixtures/relative-assets-app/source/stylesheets/relative_assets.css.sass b/middleman-more/fixtures/relative-assets-app/source/stylesheets/relative_assets.css.sass index 5a67f373..3c10c7cf 100755 --- a/middleman-more/fixtures/relative-assets-app/source/stylesheets/relative_assets.css.sass +++ b/middleman-more/fixtures/relative-assets-app/source/stylesheets/relative_assets.css.sass @@ -1,3 +1,3 @@ @import "compass" h1 - background: image-url("blank.gif") \ No newline at end of file + background: image-url("blank.gif")