I am trying to run bundle exec rspec
but am getting the following error that is being thrown in my call to spec_helper.rb
template.rb:8:in `<class:Template>': uninitialized constant ActiveSupport::Autoload (NameError)
Here is my spec_helper.rb
file:
require 'rubygems'
require 'rspec/rails'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
end
After switching the order of my Rspec file to the following, I no longer get the uninitialized constant error:
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/poltergeist'
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, {:js_errors=> false})
end
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With