rails-controller-assets 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +35 -0
  4. data/Rakefile +26 -0
  5. data/lib/rails-controller-assets.rb +1 -0
  6. data/lib/rails_controller_assets/controller_assets_helper.rb +71 -0
  7. data/lib/rails_controller_assets/engine.rb +12 -0
  8. data/lib/rails_controller_assets/precompiler.rb +63 -0
  9. data/lib/rails_controller_assets/version.rb +3 -0
  10. data/lib/rails_controller_assets.rb +4 -0
  11. data/spec/dummy/README.rdoc +28 -0
  12. data/spec/dummy/Rakefile +6 -0
  13. data/spec/dummy/app/assets/javascripts/application.js +1 -0
  14. data/spec/dummy/app/assets/javascripts/comments_index.js +1 -0
  15. data/spec/dummy/app/assets/javascripts/posts.js +1 -0
  16. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  17. data/spec/dummy/app/assets/stylesheets/comments_index.css +1 -0
  18. data/spec/dummy/app/assets/stylesheets/posts.css +1 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  20. data/spec/dummy/app/controllers/comments_controller.rb +3 -0
  21. data/spec/dummy/app/controllers/posts_controller.rb +2 -0
  22. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  23. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/spec/dummy/bin/bundle +3 -0
  25. data/spec/dummy/bin/rails +4 -0
  26. data/spec/dummy/bin/rake +4 -0
  27. data/spec/dummy/config/application.rb +14 -0
  28. data/spec/dummy/config/boot.rb +5 -0
  29. data/spec/dummy/config/database.yml +25 -0
  30. data/spec/dummy/config/environment.rb +5 -0
  31. data/spec/dummy/config/environments/development.rb +29 -0
  32. data/spec/dummy/config/environments/production.rb +80 -0
  33. data/spec/dummy/config/environments/test.rb +36 -0
  34. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  35. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  36. data/spec/dummy/config/initializers/inflections.rb +16 -0
  37. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  38. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  39. data/spec/dummy/config/initializers/session_store.rb +3 -0
  40. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  41. data/spec/dummy/config/locales/en.yml +23 -0
  42. data/spec/dummy/config/routes.rb +56 -0
  43. data/spec/dummy/config.ru +4 -0
  44. data/spec/dummy/log/development.log +0 -0
  45. data/spec/dummy/log/test.log +0 -0
  46. data/spec/dummy/public/404.html +58 -0
  47. data/spec/dummy/public/422.html +58 -0
  48. data/spec/dummy/public/500.html +57 -0
  49. data/spec/dummy/public/assets/application-be76c17ef80a57c5a75a6b5386fae588.css +16 -0
  50. data/spec/dummy/public/assets/application-be76c17ef80a57c5a75a6b5386fae588.css.gz +0 -0
  51. data/spec/dummy/public/assets/application-c6ccfb97230df9a638c94fcda47ec572.js +2 -0
  52. data/spec/dummy/public/assets/application-c6ccfb97230df9a638c94fcda47ec572.js.gz +0 -0
  53. data/spec/dummy/public/assets/comments_index-ccfb097412d4349399feb80f110472d7.js +1 -0
  54. data/spec/dummy/public/assets/comments_index-ccfb097412d4349399feb80f110472d7.js.gz +0 -0
  55. data/spec/dummy/public/assets/comments_index-f6e5ecbeedbb4d0236b2a90c42a70c2a.css +1 -0
  56. data/spec/dummy/public/assets/comments_index-f6e5ecbeedbb4d0236b2a90c42a70c2a.css.gz +0 -0
  57. data/spec/dummy/public/assets/manifest-56281636a8877a2bccb62ed5735d8c69.json +1 -0
  58. data/spec/dummy/public/assets/posts-5c2cbfb9aa866a49bc73f0aabe462942.css +1 -0
  59. data/spec/dummy/public/assets/posts-5c2cbfb9aa866a49bc73f0aabe462942.css.gz +0 -0
  60. data/spec/dummy/public/assets/posts-6003715dc6a2a0bc732e57a79f59c270.js +1 -0
  61. data/spec/dummy/public/assets/posts-6003715dc6a2a0bc732e57a79f59c270.js.gz +0 -0
  62. data/spec/dummy/public/favicon.ico +0 -0
  63. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  64. data/spec/dummy/tmp/cache/assets/development/sprockets/1e8f75a6b5b33970fb8e397347caa0a1 +0 -0
  65. data/spec/dummy/tmp/cache/assets/development/sprockets/24204f742af588c8166d3160b500d20f +0 -0
  66. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  67. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  68. data/spec/dummy/tmp/cache/assets/development/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
  69. data/spec/dummy/tmp/cache/assets/development/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
  70. data/spec/dummy/tmp/cache/assets/development/sprockets/62900b09db994747c646c1a8a2cad2ae +0 -0
  71. data/spec/dummy/tmp/cache/assets/development/sprockets/7ddd06f06023365be23872cb5768ceb9 +0 -0
  72. data/spec/dummy/tmp/cache/assets/development/sprockets/8f8dc63ea45a2e403e10a0625e75c81b +0 -0
  73. data/spec/dummy/tmp/cache/assets/development/sprockets/ad62e50a8bf2623c0cb5b8e285e1acd3 +0 -0
  74. data/spec/dummy/tmp/cache/assets/development/sprockets/c43e417f6b59ee20425870f841e1363d +0 -0
  75. data/spec/dummy/tmp/cache/assets/development/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
  76. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  77. data/spec/dummy/tmp/cache/assets/development/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
  78. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  79. data/spec/dummy/tmp/cache/assets/development/sprockets/f3797dd294a807eec294aa8bd1f8363f +0 -0
  80. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  81. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  82. data/spec/dummy/tmp/cache/assets/test/sprockets/1e8f75a6b5b33970fb8e397347caa0a1 +0 -0
  83. data/spec/dummy/tmp/cache/assets/test/sprockets/24204f742af588c8166d3160b500d20f +0 -0
  84. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  85. data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  86. data/spec/dummy/tmp/cache/assets/test/sprockets/3ba4d260ef2acf31fa4f8ecdbbb742de +0 -0
  87. data/spec/dummy/tmp/cache/assets/test/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
  88. data/spec/dummy/tmp/cache/assets/test/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
  89. data/spec/dummy/tmp/cache/assets/test/sprockets/62900b09db994747c646c1a8a2cad2ae +0 -0
  90. data/spec/dummy/tmp/cache/assets/test/sprockets/7ddd06f06023365be23872cb5768ceb9 +0 -0
  91. data/spec/dummy/tmp/cache/assets/test/sprockets/8b1bcae374c481a3ccafebe5018932e2 +0 -0
  92. data/spec/dummy/tmp/cache/assets/test/sprockets/8f8dc63ea45a2e403e10a0625e75c81b +0 -0
  93. data/spec/dummy/tmp/cache/assets/test/sprockets/ad62e50a8bf2623c0cb5b8e285e1acd3 +0 -0
  94. data/spec/dummy/tmp/cache/assets/test/sprockets/c43e417f6b59ee20425870f841e1363d +0 -0
  95. data/spec/dummy/tmp/cache/assets/test/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
  96. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  97. data/spec/dummy/tmp/cache/assets/test/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
  98. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  99. data/spec/dummy/tmp/cache/assets/test/sprockets/e6af6faede0b3537396eb6b6048506a6 +0 -0
  100. data/spec/dummy/tmp/cache/assets/test/sprockets/f3797dd294a807eec294aa8bd1f8363f +0 -0
  101. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  102. data/spec/integration/precompile_spec.rb +41 -0
  103. data/spec/spec_helper.rb +12 -0
  104. metadata +253 -0
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,56 @@
1
+ Dummy::Application.routes.draw do
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
+
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
10
+
11
+ # Example of named route that can be invoked with purchase_url(id: product.id)
12
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
+
14
+ # Example resource route (maps HTTP verbs to controller actions automatically):
15
+ # resources :products
16
+
17
+ # Example resource route with options:
18
+ # resources :products do
19
+ # member do
20
+ # get 'short'
21
+ # post 'toggle'
22
+ # end
23
+ #
24
+ # collection do
25
+ # get 'sold'
26
+ # end
27
+ # end
28
+
29
+ # Example resource route with sub-resources:
30
+ # resources :products do
31
+ # resources :comments, :sales
32
+ # resource :seller
33
+ # end
34
+
35
+ # Example resource route with more complex sub-resources:
36
+ # resources :products do
37
+ # resources :comments
38
+ # resources :sales do
39
+ # get 'recent', on: :collection
40
+ # end
41
+ # end
42
+
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
49
+
50
+ # Example resource route within a namespace:
51
+ # namespace :admin do
52
+ # # Directs /admin/products/* to Admin::ProductsController
53
+ # # (app/controllers/admin/products_controller.rb)
54
+ # resources :products
55
+ # end
56
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
File without changes
File without changes
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
@@ -0,0 +1,16 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+
12
+
13
+ */
14
+
15
+ body#comments-index {}
16
+ body#posts {}
@@ -0,0 +1,2 @@
1
+ // Nothing to watch here
2
+ ;
@@ -0,0 +1 @@
1
+ CommentsIndex = function() {};
@@ -0,0 +1 @@
1
+ {"files":{"application-2f85e5d957a13f88f0308e34c0e5a9e9.js":{"logical_path":"application.js","mtime":"2013-11-24T14:30:41+00:00","size":27,"digest":"2f85e5d957a13f88f0308e34c0e5a9e9"},"comments_index-31a49ea6a4a45778e45d0977f9b648ef.js":{"logical_path":"comments_index.js","mtime":"2013-11-24T14:50:48+00:00","size":31,"digest":"31a49ea6a4a45778e45d0977f9b648ef"},"posts-24fdcd6999445af6da797651f6d56a18.js":{"logical_path":"posts.js","mtime":"2013-11-24T14:49:13+00:00","size":23,"digest":"24fdcd6999445af6da797651f6d56a18"},"application-e2eafbc80e507d665f071afb56d4b119.css":{"logical_path":"application.css","mtime":"2013-11-24T14:51:11+00:00","size":550,"digest":"e2eafbc80e507d665f071afb56d4b119"},"comments_index-e9394d36b10b49811d8e263dc3db082c.css":{"logical_path":"comments_index.css","mtime":"2013-11-24T14:51:11+00:00","size":23,"digest":"e9394d36b10b49811d8e263dc3db082c"},"posts-d2dab16eca32d95bbf6ccdc975ac9505.css":{"logical_path":"posts.css","mtime":"2013-11-24T14:49:48+00:00","size":14,"digest":"d2dab16eca32d95bbf6ccdc975ac9505"},"application-c6ccfb97230df9a638c94fcda47ec572.js":{"logical_path":"application.js","mtime":"2013-11-24T14:30:41+00:00","size":27,"digest":"c6ccfb97230df9a638c94fcda47ec572"},"comments_index-ccfb097412d4349399feb80f110472d7.js":{"logical_path":"comments_index.js","mtime":"2013-11-24T14:50:48+00:00","size":31,"digest":"ccfb097412d4349399feb80f110472d7"},"posts-6003715dc6a2a0bc732e57a79f59c270.js":{"logical_path":"posts.js","mtime":"2013-11-24T14:49:13+00:00","size":23,"digest":"6003715dc6a2a0bc732e57a79f59c270"},"application-be76c17ef80a57c5a75a6b5386fae588.css":{"logical_path":"application.css","mtime":"2013-11-24T20:41:36+00:00","size":550,"digest":"be76c17ef80a57c5a75a6b5386fae588"},"comments_index-f6e5ecbeedbb4d0236b2a90c42a70c2a.css":{"logical_path":"comments_index.css","mtime":"2013-11-24T14:51:11+00:00","size":23,"digest":"f6e5ecbeedbb4d0236b2a90c42a70c2a"},"posts-5c2cbfb9aa866a49bc73f0aabe462942.css":{"logical_path":"posts.css","mtime":"2013-11-24T14:49:48+00:00","size":14,"digest":"5c2cbfb9aa866a49bc73f0aabe462942"},"application-8a4702a041e7951520cd27aedcbf3646.css":{"logical_path":"application.css","mtime":"2013-11-24T20:41:13+00:00","size":556,"digest":"8a4702a041e7951520cd27aedcbf3646"},"comments_show-7ab7b8a99598012212ab230d57c57f6e.css":{"logical_path":"comments_show.css","mtime":"2013-11-24T20:41:13+00:00","size":6,"digest":"7ab7b8a99598012212ab230d57c57f6e"}},"assets":{"application.js":"application-c6ccfb97230df9a638c94fcda47ec572.js","comments_index.js":"comments_index-ccfb097412d4349399feb80f110472d7.js","posts.js":"posts-6003715dc6a2a0bc732e57a79f59c270.js","application.css":"application-be76c17ef80a57c5a75a6b5386fae588.css","comments_index.css":"comments_index-f6e5ecbeedbb4d0236b2a90c42a70c2a.css","posts.css":"posts-5c2cbfb9aa866a49bc73f0aabe462942.css","comments_show.css":"comments_show-7ab7b8a99598012212ab230d57c57f6e.css"}}
@@ -0,0 +1 @@
1
+ Posts = function() {};
File without changes
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Precompiling assets' do
4
+ let(:posts_stylesheets) {
5
+ Dir[Rails.root.join("public/assets/posts-*.css")]
6
+ }
7
+
8
+ let(:posts_javascripts) {
9
+ Dir[Rails.root.join("public/assets/posts-*.js")]
10
+ }
11
+
12
+ let(:comments_stylesheets) {
13
+ Dir[Rails.root.join("public/assets/comments_index-*.css")]
14
+ }
15
+
16
+ let(:comments_javascripts) {
17
+ Dir[Rails.root.join("public/assets/comments_index-*.js")]
18
+ }
19
+
20
+ before(:all) do
21
+ task = Sprockets::Rails::Task.new(Rails.application)
22
+ task.manifest.clobber
23
+ task.manifest.compile(task.assets)
24
+ end
25
+
26
+ it 'precompilers controller stylesheets' do
27
+ expect(posts_stylesheets.size).to eq(1)
28
+ expect(File.read(posts_stylesheets.first)).to eq("body#posts {}\n")
29
+
30
+ expect(comments_stylesheets.size).to eq(1)
31
+ expect(File.read(comments_stylesheets.first)).to eq("body#comments-index {}\n")
32
+ end
33
+
34
+ it 'precompilers controller javascripts' do
35
+ expect(posts_javascripts.size).to eq(1)
36
+ expect(File.read(posts_javascripts.first)).to eq("Posts = function() {};\n")
37
+
38
+ expect(comments_javascripts.size).to eq(1)
39
+ expect(File.read(comments_javascripts.first)).to eq("CommentsIndex = function() {};\n")
40
+ end
41
+ end
@@ -0,0 +1,12 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+
3
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
+
5
+ require 'sprockets/rails/task'
6
+ require 'sprockets/railtie'
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
10
+
11
+ RSpec.configure do |config|
12
+ end