react-rails icon indicating copy to clipboard operation
react-rails copied to clipboard

Removing react-rails causes some views to not be able to access Rails helpers

Open hahuang65 opened this issue 3 years ago • 0 comments

Steps to reproduce

If we just comment out gem 'react-rails' and bundle install, the test fails with the view unable to access a Rails helper method.

$ git diff
diff --git a/Gemfile b/Gemfile
index ea0a11cc7..e8843da79 100644
--- a/Gemfile
+++ b/Gemfile
@@ -24,6 +24,7 @@ gem 'paperclip'
 gem 'pg'
 gem 'rails', '~> 5.2.3'
 gem 'rails_admin'
+# gem 'react-rails', '~> 1.10.0'
 gem 'sentry-raven'
 gem 'sidekiq'
 gem 'sidekiq-datadog

Expected behavior

$ bin/rspec spec/views/search_subscription_mailer/update.html.haml_spec.rb
..

Finished in 1.74 seconds (files took 25.33 seconds to load)
2 examples, 0 failures

Actual behavior

Tests fail, not able to access the helper methods. I've shortened the output by removing the stacktrace, and removing the second failure message since it duplicates the first.

$ bin/rspec spec/views/search_subscription_mailer/update.html.haml_spec.rb
FF

Failures:

  1) search_subscription_mailer/update.html.haml should show the number of updated items
     Failure/Error: = company_column_filter_selected_autocomplete_items(filter_params).map {|i| i[:label]}.join(', ')

     ActionView::Template::Error:
       undefined method `company_column_filter_selected_autocomplete_items' for #<#<Class:0x00007f9499b78f10>:0x00007f9499b8dac8>
       Did you mean?  company_customize_display_columns_url

Finished in 2.18 seconds (files took 23.58 seconds to load)
2 examples, 2 failures

System configuration

Sprockets or Webpacker version: sprockets 3.7.2, sprocket-rails 3.2.2, webpacker 5.4.3 React-Rails version: 1.10.0 Rect_UJS version: ??? Rails version: 5.2.6 Ruby version: 2.6.2p47


This doesn't seem like it should have anything to do with react-rails but I can't figure out why this behavior is occurring.

hahuang65 avatar Apr 20 '22 04:04 hahuang65