Rails In-memory SQLite3 schema-loading for Cucumber

This is a quick note to myself, ask me if you’d like to find out more. You’d like to load your db schema everytime you run cucumber, here’s how. Add this in env.rb:
Before do
  ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])
  ActiveRecord::Schema.verbose = false
  load "#{RAILS_ROOT}/db/schema.rb"
end
← Return to Blog