Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@palkan
Created February 28, 2019 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palkan/68be286cdff1f01e58738e5df2c4083a to your computer and use it in GitHub Desktop.
Save palkan/68be286cdff1f01e58738e5df2c4083a to your computer and use it in GitHub Desktop.
rspec-rails vs. Rails 6.0.0.beta2
# frozen_string_literal: true
# PR: https://github.com/rspec/rspec-rails/pull/2095
RSpec::Rails::ViewRendering::EmptyTemplateHandler.singleton_class.prepend(Module.new do
def call(template, _source)
super(template)
end
end)
# Issue: https://github.com/rspec/rspec-rails/issues/2094
RSpec::Rails::ViewRendering::EmptyTemplateResolver.singleton_class.prepend(Module.new do
def nullify_template_rendering(templates)
templates.map do |template|
::ActionView::Template.new(
"",
template.identifier,
RSpec::Rails::ViewRendering::EmptyTemplateHandler,
virtual_path: template.virtual_path,
format: template.format
)
end
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment