diff --git a/lib/react/rails/test_helper.rb b/lib/react/rails/test_helper.rb index 4d06512f..b54f6e78 100644 --- a/lib/react/rails/test_helper.rb +++ b/lib/react/rails/test_helper.rb @@ -9,9 +9,7 @@ module TestHelper # assert_equal "Hello world", props[:message] # end def assert_react_component(name) - assert_select "div[data-react-class]" do |dom| - assert_select "[data-react-class=?]", name - + assert_select "div[data-react-class=?]", name do |dom| if block_given? props = JSON.parse(dom.attr("data-react-props")) props.deep_transform_keys! { |key| key.to_s.underscore } diff --git a/lib/react/server_rendering/webpacker_manifest_container.rb b/lib/react/server_rendering/webpacker_manifest_container.rb index d2531fca..4f2ecfbc 100644 --- a/lib/react/server_rendering/webpacker_manifest_container.rb +++ b/lib/react/server_rendering/webpacker_manifest_container.rb @@ -79,7 +79,7 @@ def file_path path end elsif MAJOR >= 3 def file_path path - ::Rails.root.join('public', manifest.lookup(path)[1..-1]) + ::Rails.root.join('public', manifest.lookup!(path)[1..-1]) end else # 1.0 and 1.1 support def file_path path diff --git a/package.json b/package.json index bb9edc52..bcf27136 100644 --- a/package.json +++ b/package.json @@ -12,5 +12,8 @@ }, "devDependencies": { "webpack": "^2.3.3" + }, + "dependencies": { + "react_ujs": "^2.4.4" } } diff --git a/test/dummy_webpacker1/app/views/pages/show.html.erb b/test/dummy_webpacker1/app/views/pages/show.html.erb index 04644a30..4c46b12d 100644 --- a/test/dummy_webpacker1/app/views/pages/show.html.erb +++ b/test/dummy_webpacker1/app/views/pages/show.html.erb @@ -4,7 +4,7 @@