I'm working on a Rails project and I am setting up RSpec with FactoryGirl, Faker, and DatabaseCleaner. This is my Gemfile so far:
source 'https://rubygems.org'
ruby '2.1.2'
gem 'rails', '4.1.1'
gem 'pg'
gem 'sass-rails', '~> 4.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0'
gem 'jquery-rails'
gem 'haml', '~> 4.0'
gem 'devise', '~> 3.2'
gem 'jbuilder', '~> 2.0'
group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'lograge'
gem 'pry-rails'
end
group :test do
gem 'rspec-rails', '~> 3.0'
gem 'factory_girl_rails'
gem 'faker'
end
gem 'sdoc', '~> 0.4', group: :doc
gem 'spring', group: :development
gem 'rails_12factor', group: :production
This is my spec/rails_helper.rb
:
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
end
Now, when I run the specs via the bin/rspec
executable, I get this mixture of warnings and errors (I had to put it in a Gist because of the character limit on StackOverflow). Also, there seems to be some database warnings logged in my log/test.log
file which is also in a Gist.
If you look right at the end, the one spec I've written (which creates a new Organisation
factory) actually passes. When $VERBOSE = nil
the warnings and errors do not appear and all I get is:
.
Finished in 0.35145 seconds (files took 1.61 seconds to load)
1 example, 0 failures
I can't seem to figure out what the warnings mean and I was wondering whether you know how to fix/get rid of them?