Permalink
Browse files

run migrations before run test

  • Loading branch information...
1 parent 0b68f50 commit 745d5e46c43543fa6354036790c35282fbb2ce81 @dukex committed Apr 14, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 spec/spec_helper.rb
View
6 spec/spec_helper.rb
@@ -19,9 +19,14 @@ def load_resources
yield
reload_routes!
end
+
def reload_routes!
Rails.application.reload_routes!
end
+
+ def run_migrations!
+ system "cd spec/dummy && RAILS_ENV=test bundle exec rake db:migrate"
+ end
end
# Requires supporting ruby files with custom matchers and macros, etc,
@@ -31,6 +36,7 @@ def reload_routes!
include UtopiaDataIntegrationSpecHelper
load_defaults!
reload_routes!
+run_migrations!
RSpec.configure do |config|
# ## Mock Framework

0 comments on commit 745d5e4

Please sign in to comment.