Getting the error message:
NoMethodError:
undefined method `keys' for nil:NilClass
# /home/mustermann/.rvm/gems/ruby-2.3.3@foo/gems/shoulda-matchers-3.1.1/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb:121:in `rendered_layouts'
# /home/mustermann/.rvm/gems/ruby-2.3.3@foo/gems/shoulda-matchers-3.1.1/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb:109:in `rendered_with_layout?'
# /home/mustermann/.rvm/gems/ruby-2.3.3@foo/gems/shoulda-matchers-3.1.1/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb:85:in `matches?'
# ./spec/controllers/application_controller_spec.rb:20:in `block (3 levels) in <top (required)>'
When trying to run a render_with_layout spec without the rails-controller-testing gem in Rails 5.0.1.
Add the rails-controller-testing gem to your Gemfile
Yeah, we should definitely add this to the gemspec, I think.
rails-controller-testing gem requires Rails 5, so we can't add it to gemspec while supporting Rails 4.2.
I will add a note about it to tREADME.md
@guialbuk Ah, very good point. 馃憤
If you're using rspec-rails 3.5.0+ then you'll get rails-controller-testing for free: https://github.com/rspec/rspec-rails/issues/1393. Otherwise, you'll have to add it yourself. I added a note about this here: 43f4d05a18a2c2c0f57bc4b231fc2ed59590bc6b.