Skip to content
Browse files

Add missing column, and fix the spec_helper to connect to a memory sq…

…lite3 database and load the schema.
  • Loading branch information...
1 parent d9c1108 commit f88d4e5147e51d755de0dc0ac14b37df36d81bc0 @cmeiklejohn committed
Showing with 10 additions and 1 deletion.
  1. +1 −0 db/schema.rb
  2. +9 −1 spec/spec_helper.rb
View
1 db/schema.rb
@@ -11,6 +11,7 @@
create_table :cars, :force => true do |t|
t.string :name
+ t.integer :garage_id
t.timestamps
end
end
View
10 spec/spec_helper.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8
-ENV["RAILS_ENV"] = "test"
+ENV["RAILS_ENV"] ||= "test"
PROJECT_ROOT = File.expand_path("../..", __FILE__)
$LOAD_PATH << File.join(PROJECT_ROOT, "lib")
@@ -22,6 +22,14 @@
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
+ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
+
+ActiveRecord::Base.silence do
+ ActiveRecord::Migration.verbose = false
+
+ load(File.dirname(__FILE__) + '/../db/schema.rb')
+end
+
RSpec.configure do |config|
config.use_transactional_fixtures = true
config.backtrace_clean_patterns << %r{gems/}

0 comments on commit f88d4e5

Please sign in to comment.
Something went wrong with that request. Please try again.