undefined method `get' for #<RSpec::ExampleGroups
Closed this issue · 1 comments
jasonfb commented
Failure/Error: get :index
NoMethodError:
undefined method `get' for #<RSpec::ExampleGroups::AbcController:0x007f9d215f2d80>
Did you mean? gets
gem
jasonfb commented
this can happen under the following conditions:
-
your spec does not have
type: :controller
(or:type => :controller
) OR (your spec is not in the controllers folder AND you have setconfig.infer_spec_type_from_file_location!
) … see this SO post -
you have written a spec using the old-style
require 'spec_helper'
instead of using the newerrequire 'rails_helper'
. You will note thatrails_helper
now includesspec_helper
(to generate both see the Rspec installation steps)