@@ -28,6 +28,9 @@ def setup
28
28
foo.css foo.js bar.css bar.js
29
29
file1.css file1.js file2.css file2.js
30
30
)
31
+ @view . request = ActionDispatch ::Request . new ( {
32
+ "rack.url_scheme" => "https"
33
+ } )
31
34
32
35
@assets . context_class . assets_prefix = @view . assets_prefix
33
36
@assets . context_class . config = @view . config
@@ -177,42 +180,42 @@ def setup
177
180
end
178
181
179
182
def test_javascript_path
180
- assert_equal "//assets.example.com/javascripts/xmlhr.js" , @view . javascript_path ( "xmlhr" )
181
- assert_equal "//assets.example.com/javascripts/xmlhr.js" , @view . javascript_path ( "xmlhr.js" )
182
- assert_equal "//assets.example.com/javascripts/super/xmlhr.js" , @view . javascript_path ( "super/xmlhr" )
183
- assert_equal "//assets.example.com/super/xmlhr.js" , @view . javascript_path ( "/super/xmlhr" )
184
-
185
- assert_equal "//assets.example.com/javascripts/xmlhr.js?foo=1" , @view . javascript_path ( "xmlhr.js?foo=1" )
186
- assert_equal "//assets.example.com/javascripts/xmlhr.js?foo=1" , @view . javascript_path ( "xmlhr?foo=1" )
187
- assert_equal "//assets.example.com/javascripts/xmlhr.js#hash" , @view . javascript_path ( "xmlhr.js#hash" )
188
- assert_equal "//assets.example.com/javascripts/xmlhr.js#hash" , @view . javascript_path ( "xmlhr#hash" )
189
- assert_equal "//assets.example.com/javascripts/xmlhr.js?foo=1#hash" , @view . javascript_path ( "xmlhr.js?foo=1#hash" )
190
-
191
- assert_dom_equal %(<script src="//assets.example.com/assets/foo.js"></script>) ,
183
+ assert_equal "https: //assets.example.com/javascripts/xmlhr.js" , @view . javascript_path ( "xmlhr" )
184
+ assert_equal "https: //assets.example.com/javascripts/xmlhr.js" , @view . javascript_path ( "xmlhr.js" )
185
+ assert_equal "https: //assets.example.com/javascripts/super/xmlhr.js" , @view . javascript_path ( "super/xmlhr" )
186
+ assert_equal "https: //assets.example.com/super/xmlhr.js" , @view . javascript_path ( "/super/xmlhr" )
187
+
188
+ assert_equal "https: //assets.example.com/javascripts/xmlhr.js?foo=1" , @view . javascript_path ( "xmlhr.js?foo=1" )
189
+ assert_equal "https: //assets.example.com/javascripts/xmlhr.js?foo=1" , @view . javascript_path ( "xmlhr?foo=1" )
190
+ assert_equal "https: //assets.example.com/javascripts/xmlhr.js#hash" , @view . javascript_path ( "xmlhr.js#hash" )
191
+ assert_equal "https: //assets.example.com/javascripts/xmlhr.js#hash" , @view . javascript_path ( "xmlhr#hash" )
192
+ assert_equal "https: //assets.example.com/javascripts/xmlhr.js?foo=1#hash" , @view . javascript_path ( "xmlhr.js?foo=1#hash" )
193
+
194
+ assert_dom_equal %(<script src="https: //assets.example.com/assets/foo.js"></script>) ,
192
195
@view . javascript_include_tag ( "foo" )
193
- assert_dom_equal %(<script src="//assets.example.com/assets/foo.js"></script>) ,
196
+ assert_dom_equal %(<script src="https: //assets.example.com/assets/foo.js"></script>) ,
194
197
@view . javascript_include_tag ( "foo.js" )
195
- assert_dom_equal %(<script src="//assets.example.com/assets/foo.js"></script>) ,
198
+ assert_dom_equal %(<script src="https: //assets.example.com/assets/foo.js"></script>) ,
196
199
@view . javascript_include_tag ( :foo )
197
200
end
198
201
199
202
def test_stylesheet_path
200
- assert_equal "//assets.example.com/stylesheets/bank.css" , @view . stylesheet_path ( "bank" )
201
- assert_equal "//assets.example.com/stylesheets/bank.css" , @view . stylesheet_path ( "bank.css" )
202
- assert_equal "//assets.example.com/stylesheets/subdir/subdir.css" , @view . stylesheet_path ( "subdir/subdir" )
203
- assert_equal "//assets.example.com/subdir/subdir.css" , @view . stylesheet_path ( "/subdir/subdir.css" )
204
-
205
- assert_equal "//assets.example.com/stylesheets/bank.css?foo=1" , @view . stylesheet_path ( "bank.css?foo=1" )
206
- assert_equal "//assets.example.com/stylesheets/bank.css?foo=1" , @view . stylesheet_path ( "bank?foo=1" )
207
- assert_equal "//assets.example.com/stylesheets/bank.css#hash" , @view . stylesheet_path ( "bank.css#hash" )
208
- assert_equal "//assets.example.com/stylesheets/bank.css#hash" , @view . stylesheet_path ( "bank#hash" )
209
- assert_equal "//assets.example.com/stylesheets/bank.css?foo=1#hash" , @view . stylesheet_path ( "bank.css?foo=1#hash" )
210
-
211
- assert_dom_equal %(<link href="//assets.example.com/assets/foo.css" media="screen" rel="stylesheet" />) ,
203
+ assert_equal "https: //assets.example.com/stylesheets/bank.css" , @view . stylesheet_path ( "bank" )
204
+ assert_equal "https: //assets.example.com/stylesheets/bank.css" , @view . stylesheet_path ( "bank.css" )
205
+ assert_equal "https: //assets.example.com/stylesheets/subdir/subdir.css" , @view . stylesheet_path ( "subdir/subdir" )
206
+ assert_equal "https: //assets.example.com/subdir/subdir.css" , @view . stylesheet_path ( "/subdir/subdir.css" )
207
+
208
+ assert_equal "https: //assets.example.com/stylesheets/bank.css?foo=1" , @view . stylesheet_path ( "bank.css?foo=1" )
209
+ assert_equal "https: //assets.example.com/stylesheets/bank.css?foo=1" , @view . stylesheet_path ( "bank?foo=1" )
210
+ assert_equal "https: //assets.example.com/stylesheets/bank.css#hash" , @view . stylesheet_path ( "bank.css#hash" )
211
+ assert_equal "https: //assets.example.com/stylesheets/bank.css#hash" , @view . stylesheet_path ( "bank#hash" )
212
+ assert_equal "https: //assets.example.com/stylesheets/bank.css?foo=1#hash" , @view . stylesheet_path ( "bank.css?foo=1#hash" )
213
+
214
+ assert_dom_equal %(<link href="https: //assets.example.com/assets/foo.css" media="screen" rel="stylesheet" />) ,
212
215
@view . stylesheet_link_tag ( "foo" )
213
- assert_dom_equal %(<link href="//assets.example.com/assets/foo.css" media="screen" rel="stylesheet" />) ,
216
+ assert_dom_equal %(<link href="https: //assets.example.com/assets/foo.css" media="screen" rel="stylesheet" />) ,
214
217
@view . stylesheet_link_tag ( "foo.css" )
215
- assert_dom_equal %(<link href="//assets.example.com/assets/foo.css" media="screen" rel="stylesheet" />) ,
218
+ assert_dom_equal %(<link href="https: //assets.example.com/assets/foo.css" media="screen" rel="stylesheet" />) ,
216
219
@view . stylesheet_link_tag ( :foo )
217
220
end
218
221
0 commit comments