2
2
3
3
require 'action_view'
4
4
require 'sprockets'
5
+ require 'sprockets/rails'
5
6
require 'sprockets/rails/context'
6
7
require 'sprockets/rails/helper'
7
8
require 'rails/version'
@@ -113,7 +114,7 @@ def assert_servable_asset_url(url)
113
114
114
115
class NoHostHelperTest < HelperTest
115
116
def test_javascript_include_tag
116
- ActiveSupport :: Deprecation . silence do
117
+ Sprockets :: Rails . deprecator . silence do
117
118
assert_dom_equal %(<script src="/javascripts/static.js"></script>) ,
118
119
@view . javascript_include_tag ( "static" )
119
120
assert_dom_equal %(<script src="/javascripts/static.js"></script>) ,
@@ -141,7 +142,7 @@ def test_javascript_include_tag
141
142
end
142
143
143
144
def test_stylesheet_link_tag
144
- ActiveSupport :: Deprecation . silence do
145
+ Sprockets :: Rails . deprecator . silence do
145
146
assert_dom_equal %(<link href="/stylesheets/static.css" #{ append_media_attribute } rel="stylesheet" />) ,
146
147
@view . stylesheet_link_tag ( "static" )
147
148
assert_dom_equal %(<link href="/stylesheets/static.css" #{ append_media_attribute } rel="stylesheet" />) ,
@@ -169,7 +170,7 @@ def test_stylesheet_link_tag
169
170
end
170
171
171
172
def test_javascript_include_tag_integrity
172
- ActiveSupport :: Deprecation . silence do
173
+ Sprockets :: Rails . deprecator . silence do
173
174
assert_dom_equal %(<script src="/javascripts/static.js" integrity="sha-256-TvVUHzSfftWg1rcfL6TIJ0XKEGrgLyEq6lEpcmrG9qs="></script>) ,
174
175
@view . javascript_include_tag ( "static" , integrity : "sha-256-TvVUHzSfftWg1rcfL6TIJ0XKEGrgLyEq6lEpcmrG9qs=" )
175
176
@@ -183,7 +184,7 @@ def test_javascript_include_tag_integrity
183
184
end
184
185
185
186
def test_stylesheet_link_tag_integrity
186
- ActiveSupport :: Deprecation . silence do
187
+ Sprockets :: Rails . deprecator . silence do
187
188
assert_dom_equal %(<link href="/stylesheets/static.css" #{ append_media_attribute } rel="stylesheet" integrity="sha-256-5YzTQPuOJz/EpeXfN/+v1sxsjAj/dw8q26abiHZM3A4=" />) ,
188
189
@view . stylesheet_link_tag ( "static" , integrity : "sha-256-5YzTQPuOJz/EpeXfN/+v1sxsjAj/dw8q26abiHZM3A4=" )
189
190
@@ -195,7 +196,7 @@ def test_stylesheet_link_tag_integrity
195
196
end
196
197
197
198
def test_javascript_path
198
- ActiveSupport :: Deprecation . silence do
199
+ Sprockets :: Rails . deprecator . silence do
199
200
assert_equal "/javascripts/xmlhr.js" , @view . javascript_path ( "xmlhr" )
200
201
assert_equal "/javascripts/xmlhr.js" , @view . javascript_path ( "xmlhr.js" )
201
202
assert_equal "/javascripts/super/xmlhr.js" , @view . javascript_path ( "super/xmlhr" )
@@ -210,7 +211,7 @@ def test_javascript_path
210
211
end
211
212
212
213
def test_stylesheet_path
213
- ActiveSupport :: Deprecation . silence do
214
+ Sprockets :: Rails . deprecator . silence do
214
215
assert_equal "/stylesheets/bank.css" , @view . stylesheet_path ( "bank" )
215
216
assert_equal "/stylesheets/bank.css" , @view . stylesheet_path ( "bank.css" )
216
217
assert_equal "/stylesheets/subdir/subdir.css" , @view . stylesheet_path ( "subdir/subdir" )
@@ -233,7 +234,7 @@ def setup
233
234
end
234
235
235
236
def test_javascript_include_tag_integrity
236
- ActiveSupport :: Deprecation . silence do
237
+ Sprockets :: Rails . deprecator . silence do
237
238
assert_dom_equal %(<script src="/javascripts/static.js"></script>) ,
238
239
@view . javascript_include_tag ( "static" , integrity : true )
239
240
assert_dom_equal %(<script src="/javascripts/static.js"></script>) ,
@@ -250,7 +251,7 @@ def test_javascript_include_tag_integrity
250
251
end
251
252
252
253
def test_stylesheet_link_tag_integrity
253
- ActiveSupport :: Deprecation . silence do
254
+ Sprockets :: Rails . deprecator . silence do
254
255
assert_dom_equal %(<link href="/stylesheets/static.css" #{ append_media_attribute } rel="stylesheet" />) ,
255
256
@view . stylesheet_link_tag ( "static" , integrity : true )
256
257
assert_dom_equal %(<link href="/stylesheets/static.css" #{ append_media_attribute } rel="stylesheet" />) ,
@@ -324,7 +325,7 @@ def setup
324
325
end
325
326
326
327
def test_javascript_path
327
- ActiveSupport :: Deprecation . silence do
328
+ Sprockets :: Rails . deprecator . silence do
328
329
assert_equal "https://assets.example.com/javascripts/xmlhr.js" , @view . javascript_path ( "xmlhr" )
329
330
assert_equal "https://assets.example.com/javascripts/xmlhr.js" , @view . javascript_path ( "xmlhr.js" )
330
331
assert_equal "https://assets.example.com/javascripts/super/xmlhr.js" , @view . javascript_path ( "super/xmlhr" )
@@ -346,7 +347,7 @@ def test_javascript_path
346
347
end
347
348
348
349
def test_stylesheet_path
349
- ActiveSupport :: Deprecation . silence do
350
+ Sprockets :: Rails . deprecator . silence do
350
351
assert_equal "https://assets.example.com/stylesheets/bank.css" , @view . stylesheet_path ( "bank" )
351
352
assert_equal "https://assets.example.com/stylesheets/bank.css" , @view . stylesheet_path ( "bank.css" )
352
353
assert_equal "https://assets.example.com/stylesheets/subdir/subdir.css" , @view . stylesheet_path ( "subdir/subdir" )
@@ -914,7 +915,7 @@ def test_index_files
914
915
class DeprecationTest < HelperTest
915
916
def test_deprecations_for_asset_path
916
917
@view . send ( :define_singleton_method , :public_compute_asset_path , -> { } )
917
- assert_deprecated do
918
+ assert_deprecated ( "use the `skip_pipeline: true` option" , Sprockets :: Rails . deprecator ) do
918
919
@view . asset_path ( "does_not_exist.noextension" )
919
920
end
920
921
ensure
@@ -924,7 +925,7 @@ def test_deprecations_for_asset_path
924
925
def test_deprecations_for_asset_url
925
926
@view . send ( :define_singleton_method , :public_compute_asset_path , -> { } )
926
927
927
- assert_deprecated do
928
+ assert_deprecated ( "use the `skip_pipeline: true` option" , Sprockets :: Rails . deprecator ) do
928
929
@view . asset_url ( "does_not_exist.noextension" )
929
930
end
930
931
ensure
@@ -934,7 +935,7 @@ def test_deprecations_for_asset_url
934
935
def test_deprecations_for_image_tag
935
936
@view . send ( :define_singleton_method , :public_compute_asset_path , -> { } )
936
937
937
- assert_deprecated do
938
+ assert_deprecated ( "use the `skip_pipeline: true` option" , Sprockets :: Rails . deprecator ) do
938
939
@view . image_tag ( "does_not_exist.noextension" )
939
940
end
940
941
ensure
0 commit comments