Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes In Rails 6 ActionView::Template Breaks EmptyTemplateHandler #2086

Closed
erich-team opened this issue Feb 26, 2019 · 8 comments
Closed

Comments

@erich-team
Copy link

Changes to the Template handler calls in Rails 6.0 beta breaks EmptyTemplateResolver

Specifically this change which changes actionview/lib/action_view/template.rb, line 307, from this...

code = @handler.call(LegacyTemplate.new(self, source))

... to this ...

code = @handler.call(self, source)

... breaks rspec-rails, lib/rspec/rails/view_rendering.rb, line 105

def self.call(_template)

with the following error;

ActionView::Template::Error: wrong number of arguments (given 2, expected 1)

Ruby version: ruby 2.5.1p57
Rails version: 6.0.0.beta2
Rspec version: 3.8.2

@JonRowe
Copy link
Member

JonRowe commented Feb 27, 2019

Any PR for this should target 4-0-dev

@jamesjefferies
Copy link

Hi @JonRowe - targeting 4-0-dev (which currently has some test failures around Notifications) sounds like a good plan - but this patch will need to sniff which version of ActionView it's running against right? Is there a simple example of where that is already being done?

@benoittgt
Copy link
Member

@jamesjefferies Why not be Rails version specific? For example

if ::Rails::VERSION::STRING >= '5.1'

@JonRowe
Copy link
Member

JonRowe commented Feb 27, 2019

TBH I'm not sure we need to gate this, our method defines one argument, it needs two on this version of Rails, seems like simply adding a second optional argument would fix it, and gate the spec instead.

(Also 👋 @jamesjefferies)

@jamesjefferies
Copy link

@JonRowe ah yes, that sounds like the best way to sort this .. and yes! 👋

@erich-team
Copy link
Author

erich-team commented Feb 27, 2019

@JonRowe I toyed with that in a monkey-patch

def self.call(_template, source)

, but given the method doesn't use _template as it is, it seemed a reasonable future-proof solution, Just a thought.

@JonRowe
Copy link
Member

JonRowe commented Feb 27, 2019

It'd need to be _source = nil in order to remain backwards compatible.

@JonRowe
Copy link
Member

JonRowe commented Mar 1, 2019

Fixed in #2089

@JonRowe JonRowe closed this as completed Mar 1, 2019
siegfault added a commit to siegfault/expiration that referenced this issue May 18, 2019
Need to bump to beta version of rspec for the fix for
rspec/rspec-rails#2086.
maximumtiu added a commit to maximumtiu/upgrade-rails-workshop that referenced this issue Aug 13, 2019
maximumtiu added a commit to maximumtiu/upgrade-rails-workshop that referenced this issue Aug 13, 2019
ArturT added a commit to KnapsackPro/rails-app-with-knapsack_pro that referenced this issue Sep 18, 2019
thomasleese added a commit to alphagov/support that referenced this issue Oct 1, 2019
This solves a problem with Rails 6:
rspec/rspec-rails#2086
thomasleese added a commit to alphagov/support that referenced this issue Oct 1, 2019
This solves a problem with Rails 6:
rspec/rspec-rails#2086
thomasleese added a commit to alphagov/support that referenced this issue Oct 1, 2019
This solves a problem with Rails 6:
rspec/rspec-rails#2086
thomasleese added a commit to alphagov/support that referenced this issue Oct 1, 2019
This solves a problem with Rails 6:
rspec/rspec-rails#2086
cfis pushed a commit to cfis/publify that referenced this issue Oct 6, 2019
cbaines pushed a commit to alphagov/support that referenced this issue Oct 8, 2019
ozydingo added a commit to ozydingo/diaper that referenced this issue Oct 19, 2019
Update rspec-rails to 4.0.0.beta3 (required for rails 6 controller tests; see rspec/rspec-rails#2086)

Configure action_dispatch media_type return to deal with deprecation warning
seanmarcia pushed a commit to rubyforgood/human-essentials that referenced this issue Oct 20, 2019
* Perform rails app:upgrade to prepare for upgrade to rails 6. Discard most changes from this task that either clobbered app-specific setup or were unecessary comments or formatting changes.

Update Rails to 6.0.0, update all gems with outdated dependencies

* Comment out breaking call to maintain_test_schema in rspec helper

Update rspec-rails to 4.0.0.beta3 (required for rails 6 controller tests; see rspec/rspec-rails#2086)

Configure action_dispatch media_type return to deal with deprecation warning

* (organization) Set logo to nil instead of calling purge in failed validation (fixes Rails 6 breakage)

* fix(organization) Use logo= setter instead of setting local var in validation
amatriain added a commit to amatriain/feedbunch that referenced this issue Jan 3, 2020
As discussed in rspec/rspec-rails#2086 ,
rspec-rails 3.x is incompatible with rails 6, making controller tests to
fail.

For now FeedBunch will use a beta relase of rspec-rails 4, and will
switch to stable releases once rspec-rails 4 stable is released.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants