2009-11-22 15:37:11 -08:00
|
|
|
Feature: Relative Assets
|
|
|
|
In order easily switch between relative and absolute paths
|
|
|
|
|
2012-01-31 21:30:45 -08:00
|
|
|
Scenario: Previewing css with the feature disabled
|
2009-11-22 15:37:11 -08:00
|
|
|
Given "relative_assets" feature is "disabled"
|
2011-12-29 19:28:49 -08:00
|
|
|
And the Server is running at "relative-assets-app"
|
2009-11-22 15:37:11 -08:00
|
|
|
When I go to "/stylesheets/relative_assets.css"
|
2010-04-18 12:08:08 -07:00
|
|
|
Then I should not see "url('../"
|
2012-02-05 11:43:19 -08:00
|
|
|
And I should see "/images/blank.gif')"
|
2012-01-31 21:30:45 -08:00
|
|
|
|
|
|
|
Scenario: Building css with the feature disabled
|
|
|
|
Given a fixture app "relative-assets-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
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')"
|
2011-07-23 22:49:32 -07:00
|
|
|
|
|
|
|
Scenario: Rendering html with the feature disabled
|
|
|
|
Given "relative_assets" feature is "disabled"
|
2011-12-29 19:28:49 -08:00
|
|
|
And the Server is running at "relative-assets-app"
|
2011-07-23 22:49:32 -07:00
|
|
|
When I go to "/relative_image.html"
|
|
|
|
Then I should see "/images/blank.gif"
|
2009-11-22 15:37:11 -08:00
|
|
|
|
|
|
|
Scenario: Rendering css with the feature enabled
|
|
|
|
Given "relative_assets" feature is "enabled"
|
2011-12-29 19:28:49 -08:00
|
|
|
And the Server is running at "relative-assets-app"
|
2009-11-22 15:37:11 -08:00
|
|
|
When I go to "/stylesheets/relative_assets.css"
|
2011-07-23 22:49:32 -07:00
|
|
|
Then I should see "url('../images/blank.gif"
|
|
|
|
|
2012-01-31 21:30:45 -08:00
|
|
|
Scenario: Building css with the feature enabled
|
|
|
|
Given a fixture app "relative-assets-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
activate :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')"
|
|
|
|
|
2012-04-16 16:52:21 -07:00
|
|
|
Scenario: Relative css reference with directory indexes
|
|
|
|
Given a fixture app "relative-assets-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
activate :directory_indexes
|
|
|
|
activate :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"
|
|
|
|
|
2011-09-20 10:21:38 -07:00
|
|
|
Scenario: Rendering html with the feature enabled
|
2011-07-23 22:49:32 -07:00
|
|
|
Given "relative_assets" feature is "enabled"
|
2011-12-29 19:28:49 -08:00
|
|
|
And the Server is running at "relative-assets-app"
|
2011-07-23 22:49:32 -07:00
|
|
|
When I go to "/relative_image.html"
|
|
|
|
Then I should not see "/images/blank.gif"
|
|
|
|
And I should see "images/blank.gif"
|
|
|
|
|
2012-02-05 11:43:19 -08:00
|
|
|
Scenario: Rendering css with a custom images_dir
|
|
|
|
Given "relative_assets" feature is "enabled"
|
2011-07-23 22:49:32 -07:00
|
|
|
And "images_dir" is set to "img"
|
2011-12-29 19:28:49 -08:00
|
|
|
And the Server is running at "relative-assets-app"
|
2011-07-23 22:49:32 -07:00
|
|
|
When I go to "/stylesheets/relative_assets.css"
|
2012-01-31 21:30:45 -08:00
|
|
|
Then I should see "url('../img/blank.gif')"
|
2011-07-23 22:49:32 -07:00
|
|
|
|
2012-01-31 21:30:45 -08:00
|
|
|
Scenario: Building css with a custom images_dir
|
|
|
|
Given a fixture app "relative-assets-app"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
set :images_dir, "img"
|
|
|
|
activate :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
|
2011-07-23 22:49:32 -07:00
|
|
|
Given "relative_assets" feature is "enabled"
|
|
|
|
And "images_dir" is set to "img"
|
2011-12-29 19:28:49 -08:00
|
|
|
And the Server is running at "relative-assets-app"
|
2011-07-23 22:49:32 -07:00
|
|
|
When I go to "/relative_image.html"
|
|
|
|
Then I should not see "/images/blank.gif"
|
|
|
|
Then I should not see "/img/blank.gif"
|
2011-09-20 10:21:38 -07:00
|
|
|
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"
|
2012-06-30 22:02:23 -07:00
|
|
|
Then I should see "url('../fonts/StMarie-Thin.otf"
|
|
|
|
|
|
|
|
Scenario: Relative assets via image_tag
|
|
|
|
Given a fixture app "relative-assets-app"
|
|
|
|
Given "relative_assets" feature is "enabled"
|
|
|
|
And a file named "source/sub/image_tag.html.erb" with:
|
|
|
|
"""
|
|
|
|
<%= image_tag '/img/blank.gif' %>
|
|
|
|
"""
|
|
|
|
And the Server is running at "relative-assets-app"
|
|
|
|
When I go to "/sub/image_tag.html"
|
|
|
|
Then I should see '<img src="../img/blank.gif" />'
|