Rspec 3 Views Spec Undefined Local Variable or Method Render
If you’re using rspec 3, you might run into the following error when you try to run a views spec with the rake spec
command:
1 2 3 |
|
If so, try two things: first, make sure that your spec has require 'rails_helper'
, not require 'spec_helper'
. Additionally, make sure you specify type: :view
in the RSpec definition, e.g. RSpec.describe 'view.html.erb', type: :view do
.