When render_views is enabled globally, it cannot be disabled with a local render_views(false) call.
rails new reproduce_bug
cd reproduce_bug
echo 'gem "rspec-rails"' >> Gemfile
bundle
rails g rspec:install
rails g controller bugs show
Edit spec/spec_helper.rb, add config.render_views
inside the RSpec.configure
block.
Edit spec/controllers/bugs_controller_spec.rb, add render_views false
inside describe "GET 'show'"
block.
Edit app/views/bugs/show.html.erb, add <% raise "It's a trap!" %>
rspec spec/controllers/bugs_controller_spec.rb
1) BugsController GET 'show' returns http success
Failure/Error: get 'show'
ActionView::Template::Error:
It's a trap!