From efd598d913fbb817b88edbb9dbd5f753f36319d7 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Wed, 26 Oct 2011 09:38:47 -0700 Subject: [PATCH] more sprockets tests --- CHANGELOG | 4 ++++ features/sprockets.feature | 16 +++++++++++++--- features/sprockets_gems.feature | 2 +- fixtures/sprockets-app/config.rb | 4 ++-- .../sprockets-app/source/library/css/plain.css | 3 +++ .../sprockets_base1.css.scss | 0 .../sprockets_base2.css.scss | 0 .../{stylesheets => css}/sprockets_sub.css.scss | 0 .../{javascripts => js}/jquery_include.js | 0 .../sprockets-app/source/library/js/plain.js | 3 +++ .../{javascripts => js}/sprockets_base.js | 0 .../library/{javascripts => js}/sprockets_sub.js | 0 12 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 fixtures/sprockets-app/source/library/css/plain.css rename fixtures/sprockets-app/source/library/{stylesheets => css}/sprockets_base1.css.scss (100%) rename fixtures/sprockets-app/source/library/{stylesheets => css}/sprockets_base2.css.scss (100%) rename fixtures/sprockets-app/source/library/{stylesheets => css}/sprockets_sub.css.scss (100%) rename fixtures/sprockets-app/source/library/{javascripts => js}/jquery_include.js (100%) create mode 100644 fixtures/sprockets-app/source/library/js/plain.js rename fixtures/sprockets-app/source/library/{javascripts => js}/sprockets_base.js (100%) rename fixtures/sprockets-app/source/library/{javascripts => js}/sprockets_sub.js (100%) diff --git a/CHANGELOG b/CHANGELOG index b792c790..9862c18a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,10 @@ ==== Finally support Compass in Sprockets! Thanks to @xdite and @petebrowne +2.0.13.2 +==== +Update Windows eventmachine dep + 2.0.13.1 ==== build --clean shouldn't remove dotfiles diff --git a/features/sprockets.feature b/features/sprockets.feature index a50b8299..c9b79951 100644 --- a/features/sprockets.feature +++ b/features/sprockets.feature @@ -7,9 +7,14 @@ Feature: Sprockets Scenario: Sprockets JS require with custom :js_dir Given the Server is running at "sprockets-app" - When I go to "/library/javascripts/sprockets_base.js" + When I go to "/library/js/sprockets_base.js" Then I should see "sprockets_sub_function" + Scenario: Plain JS require with custom :js_dir + Given the Server is running at "sprockets-app" + When I go to "/library/css/plain.css" + Then I should see "helloWorld" + Scenario: Sprockets JS should have access to yaml data Given the Server is running at "test-app" When I go to "/javascripts/multiple_engines.js" @@ -32,10 +37,15 @@ Feature: Sprockets Scenario: Sprockets CSS require with custom :css_dir //require Given the Server is running at "sprockets-app" - When I go to "/library/stylesheets/sprockets_base1.css" + When I go to "/library/css/sprockets_base1.css" Then I should see "hello" + Scenario: Plain CSS require with custom :css_dir + Given the Server is running at "sprockets-app" + When I go to "/library/css/plain.css" + Then I should see "helloWorld" + Scenario: Sprockets CSS require with custom :css_dir @import Given the Server is running at "sprockets-app" - When I go to "/library/stylesheets/sprockets_base2.css" + When I go to "/library/css/sprockets_base2.css" Then I should see "hello" \ No newline at end of file diff --git a/features/sprockets_gems.feature b/features/sprockets_gems.feature index 720d12fa..9fdc5104 100644 --- a/features/sprockets_gems.feature +++ b/features/sprockets_gems.feature @@ -1,5 +1,5 @@ Feature: Sprockets Gems Scenario: Sprockets can pull jQuery from gem Given the Server is running at "sprockets-app" - When I go to "/library/javascripts/jquery_include.js" + When I go to "/library/js/jquery_include.js" Then I should see "var jQuery =" \ No newline at end of file diff --git a/fixtures/sprockets-app/config.rb b/fixtures/sprockets-app/config.rb index 88ac343e..4bd27653 100644 --- a/fixtures/sprockets-app/config.rb +++ b/fixtures/sprockets-app/config.rb @@ -1,2 +1,2 @@ -set :js_dir, "library/javascripts" -set :css_dir, "library/stylesheets" \ No newline at end of file +set :js_dir, "library/js" +set :css_dir, "library/css" \ No newline at end of file diff --git a/fixtures/sprockets-app/source/library/css/plain.css b/fixtures/sprockets-app/source/library/css/plain.css new file mode 100644 index 00000000..7df785e8 --- /dev/null +++ b/fixtures/sprockets-app/source/library/css/plain.css @@ -0,0 +1,3 @@ +#helloWorld { + color: red; +} \ No newline at end of file diff --git a/fixtures/sprockets-app/source/library/stylesheets/sprockets_base1.css.scss b/fixtures/sprockets-app/source/library/css/sprockets_base1.css.scss similarity index 100% rename from fixtures/sprockets-app/source/library/stylesheets/sprockets_base1.css.scss rename to fixtures/sprockets-app/source/library/css/sprockets_base1.css.scss diff --git a/fixtures/sprockets-app/source/library/stylesheets/sprockets_base2.css.scss b/fixtures/sprockets-app/source/library/css/sprockets_base2.css.scss similarity index 100% rename from fixtures/sprockets-app/source/library/stylesheets/sprockets_base2.css.scss rename to fixtures/sprockets-app/source/library/css/sprockets_base2.css.scss diff --git a/fixtures/sprockets-app/source/library/stylesheets/sprockets_sub.css.scss b/fixtures/sprockets-app/source/library/css/sprockets_sub.css.scss similarity index 100% rename from fixtures/sprockets-app/source/library/stylesheets/sprockets_sub.css.scss rename to fixtures/sprockets-app/source/library/css/sprockets_sub.css.scss diff --git a/fixtures/sprockets-app/source/library/javascripts/jquery_include.js b/fixtures/sprockets-app/source/library/js/jquery_include.js similarity index 100% rename from fixtures/sprockets-app/source/library/javascripts/jquery_include.js rename to fixtures/sprockets-app/source/library/js/jquery_include.js diff --git a/fixtures/sprockets-app/source/library/js/plain.js b/fixtures/sprockets-app/source/library/js/plain.js new file mode 100644 index 00000000..4d5c2a0f --- /dev/null +++ b/fixtures/sprockets-app/source/library/js/plain.js @@ -0,0 +1,3 @@ +function hellowWorld() { + +} \ No newline at end of file diff --git a/fixtures/sprockets-app/source/library/javascripts/sprockets_base.js b/fixtures/sprockets-app/source/library/js/sprockets_base.js similarity index 100% rename from fixtures/sprockets-app/source/library/javascripts/sprockets_base.js rename to fixtures/sprockets-app/source/library/js/sprockets_base.js diff --git a/fixtures/sprockets-app/source/library/javascripts/sprockets_sub.js b/fixtures/sprockets-app/source/library/js/sprockets_sub.js similarity index 100% rename from fixtures/sprockets-app/source/library/javascripts/sprockets_sub.js rename to fixtures/sprockets-app/source/library/js/sprockets_sub.js