rails/rails-controller-testing

Getting "uninitialized constant Rails (NameError)" error after using workaround

jasnow opened this issue · 2 comments

Why do I get this error message uninitialized constant Rails (NameError) after adding this line to Gemfile file:

gem 'rails-controller-testing'

and these 5 lines to spec/spec_helper.rb file (based on rails-controller-testing gem README)?

RSpec.configure do |config|
  config.include Rails::Controller::Testing::TestProcess
  config.include Rails::Controller::Testing::TemplateAssertions
  config.include Rails::Controller::Testing::Integration
end

Thanks.

Is your spec_helper being loaded before Rails is loaded?

Fixed