nickjj / orats

Opinionated rails application templates.
MIT License
664 stars 56 forks source link

I can't get rspec to run #25

Closed deanfields closed 7 years ago

deanfields commented 7 years ago

Hi,

I've just installed a new rails project with orats using version 5.1.1 (thank you). However I keep getting an error when I attempt to run the test suite, I've installed RSpec as normal and added a simple test spec. I've tried modifying this a few times with no luck, heres the error:

An error occurred while loading ./spec/features/test_spec.rb.
Failure/Error: require File.expand_path('../../config/environment', __FILE__)

LoadError:
  cannot load such file -- /app/spec/config/environment
# /usr/local/bundle/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
# /usr/local/bundle/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `block in require'
# /usr/local/bundle/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:in `load_dependency'
# /usr/local/bundle/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
# ./spec/support/database_cleaner.rb:3:in `<top (required)>'
# /usr/local/bundle/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
# /usr/local/bundle/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `block in require'
# /usr/local/bundle/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:in `load_dependency'
# /usr/local/bundle/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
# ./spec/rails_helper.rb:9:in `block in <top (required)>'
# ./spec/rails_helper.rb:9:in `each'
# ./spec/rails_helper.rb:9:in `<top (required)>'
# ./spec/features/test_spec.rb:1:in `<top (required)>'

Below is the gemfile I'm using:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
  "https://github.com/#{repo_name}.git"
end

gem 'rails', '~> 5.1.1'
gem 'puma', '~> 3.9'
gem 'rack-timeout', '~> 0.4'
gem 'jbuilder', '~> 2.5'
gem 'pg', '~> 0.21'
gem 'redis-rails', '~> 5.0'
gem 'sidekiq', '~> 5.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails', '~> 4.3'
gem 'turbolinks', '~> 5'
gem 'font-awesome-rails', '~> 4.7'
gem 'foundation-rails', '~> 6.3', '>= 6.3.1.0'
gem 'simple_form', '~> 3.5'
gem 'devise', '~> 4.3'
gem 'pundit', '~> 1.1'
# gem 'clockwork', '~> 2.0'
# gem 'kaminari', '~> 0.17'

group :development, :test do
  gem 'byebug', platform: :mri
  gem 'rspec-rails', '~> 3.6'
  gem 'capybara', '~> 2.14'
  gem 'selenium-webdriver'
  gem 'factory_girl_rails', '~> 4.8'
  gem 'reek', '~> 4.7', '>= 4.7.1'
end

group :development do
  gem 'rack-mini-profiler', '~> 0.10'
  gem 'web-console', '~> 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
  gem 'database_cleaner', '~> 1.6', '>= 1.6.1'
  gem 'shoulda-matchers', '~> 3.1', '>= 3.1.1'
  gem 'faker', '~> 1.7', '>= 1.7.3'
  # gem "simplecov"
  # gem "codeclimate-test-reporter", "~> 1.0.0"
end

gem 'tzinfo-data'
deanfields commented 7 years ago

My fault, I didn't notice it was referring to database_cleaner in the trace, removing the database_cleaner.rb file made it work apologies!

nickjj commented 7 years ago

No problem. Glad to see all is working with rspec (I don't use it personally but I know a lot of people do).