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

EmptyTemplateHandler::call wrong number of arguments (2 for 1) #2161

Closed
feixionglee opened this issue Aug 22, 2019 · 1 comment
Closed

EmptyTemplateHandler::call wrong number of arguments (2 for 1) #2161

feixionglee opened this issue Aug 22, 2019 · 1 comment

Comments

@feixionglee
Copy link

What Ruby, Rails and RSpec versions are you using?

Ruby version: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
Rails version: 6.0.0
RSpec version: 3.8

  • rspec-core 3.8.2
  • rspec-expectations 3.8.4
  • rspec-mocks 3.8.1
  • rspec-rails 3.8.2
  • rspec-support 3.8.2

Observed behaviour

ActionView::Template::Error:
       wrong number of arguments (given 2, expected 1)
# ~/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-rails-3.8.2/lib/rspec/rails/view_rendering.rb:105:in `call'

Expected behaviour

The specs should all pass, (all pass with rails 5.2.3)

Investigation

It failed on this method EmptyTemplateHandler::call
https://github.com/rspec/rspec-rails/blob/master/lib/rspec/rails/view_rendering.rb#L105

class EmptyTemplateHandler
    def self.call(_template)
        ::Rails.logger.info("  Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.")

        %("")
    end
end

There are arguments changes from rails
rails/rails@28f88e0#diff-562906215bf781788ec5aaf37e958cb8L307

-  code = @handler.call(LegacyTemplate.new(self, source)) 
+  code = @handler.call(self, source)
@JonRowe
Copy link
Member

JonRowe commented Aug 22, 2019

👋 This is fixed on the 4-0-dev branch. See #2089

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

2 participants