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

fix relative assets test

This commit is contained in:
Thomas Reynolds 2011-09-20 10:21:38 -07:00
parent 91e00e5289
commit bfc32ee0ef
6 changed files with 23 additions and 16 deletions

View file

@ -1,17 +1,11 @@
Feature: Web Fonts Feature: Web Fonts
Scenario: Checking built folder for content Scenario: Checking built folder for content
Given a built app at "test-app" Given a built app at "fonts-app"
Then "stylesheets/fonts.css" should exist at "test-app" and include "/fonts/StMarie-Thin.otf" Then "stylesheets/fonts.css" should exist at "fonts-app" and include "/fonts/StMarie-Thin.otf"
And cleanup built app at "test-app" And cleanup built app at "fonts-app"
Scenario: Rendering scss Scenario: Rendering scss
Given the Server is running at "test-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"
Scenario: Rendering scss with the feature enabled
Given "relative_assets" feature is "enabled"
And the Server is running at "test-app"
When I go to "/stylesheets/fonts.css"
Then I should see "url('../fonts/StMarie"

View file

@ -20,7 +20,7 @@ Feature: Relative Assets
When I go to "/stylesheets/relative_assets.css" When I go to "/stylesheets/relative_assets.css"
Then I should see "url('../images/blank.gif" Then I should see "url('../images/blank.gif"
Scenario: Rendering html with the feature disabled Scenario: Rendering html with the feature enabled
Given "relative_assets" feature is "enabled" Given "relative_assets" feature is "enabled"
And the Server is running at "test-app" And the Server is running at "test-app"
When I go to "/relative_image.html" When I go to "/relative_image.html"
@ -41,4 +41,10 @@ Feature: Relative Assets
When I go to "/relative_image.html" When I go to "/relative_image.html"
Then I should not see "/images/blank.gif" Then I should not see "/images/blank.gif"
Then I should not see "/img/blank.gif" Then I should not see "/img/blank.gif"
And I should 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"

View file

@ -1,9 +1,16 @@
Given /^"([^\"]*)" feature is "([^\"]*)"$/ do |feature, state| Given /^a clean server$/ do
@server ||= Middleman.server @server = Middleman.server
@server.set :show_exceptions, false @server.set :show_exceptions, false
end
Given /^"([^\"]*)" feature is "([^\"]*)"$/ do |feature, state|
@server = Middleman.server
@server.set :show_exceptions, false
if state == "enabled" if state == "enabled"
@server.activate(feature.to_sym) @server.activate(feature.to_sym)
end end
@server.set :environment, @current_env || :development @server.set :environment, @current_env || :development
end end

View file