22
22
class JSXTransformTest < ActionDispatch ::IntegrationTest
23
23
24
24
test 'asset pipeline should transform JSX' do
25
- get 'assets/example.js'
25
+ get '/ assets/example.js'
26
26
FileUtils . rm_r CACHE_PATH if CACHE_PATH . exist?
27
27
assert_response :success
28
28
assert_equal EXPECTED_JS , @response . body
29
29
end
30
30
31
31
test 'asset pipeline should transform JSX + Coffeescript' do
32
- get 'assets/example2.js'
32
+ get '/ assets/example2.js'
33
33
assert_response :success
34
34
# Different coffee-script may generate slightly different outputs,
35
35
# as some version inserts an extra "\n" at the beginning.
@@ -43,7 +43,7 @@ class JSXTransformTest < ActionDispatch::IntegrationTest
43
43
replacing_path = File . expand_path ( "../dummy/vendor/assets/react/JSXTransformer.js" , __FILE__ )
44
44
45
45
FileUtils . mv hidden_path , replacing_path
46
- get 'assets/example3.js'
46
+ get '/ assets/example3.js'
47
47
48
48
FileUtils . mv replacing_path , hidden_path
49
49
FileUtils . rm_r CACHE_PATH if CACHE_PATH . exist?
@@ -54,7 +54,7 @@ class JSXTransformTest < ActionDispatch::IntegrationTest
54
54
55
55
test 'accepts harmony: true option' do
56
56
React ::JSX . transform_options = { harmony : true }
57
- get 'assets/harmony_example.js'
57
+ get '/ assets/harmony_example.js'
58
58
assert_response :success
59
59
assert_match ( /generateGreeting:function\( \) / , @response . body , "object literal methods" )
60
60
assert_match ( /React.__spread/ , @response . body , "spreading props" )
0 commit comments