Skip to content

Commit

Permalink
change require order in tests to build db first
Browse files Browse the repository at this point in the history
  • Loading branch information
jdtornow committed Jul 10, 2016
1 parent 9923bb8 commit 3e03e68
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@
ENV["RAILS_ENV"] ||= "test"

require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rspec/rails"
require "factory_girl"
require "challah/test"
require "pry"

Rails.backtrace_cleaner.remove_silencers!

# Load support files
Dir["#{ File.dirname(__FILE__) }/support/**/*.rb"].each { |f| require f }
Dir["#{ File.dirname(__FILE__) }/factories/**/*.rb"].each { |f| require f }

db_files = Dir["#{ Rails.root.join("db") }/**/*challah*.rb"]

# Allow repeat tests to run, dropping the db after each suite run
Expand All @@ -29,6 +22,14 @@
`rake --rakefile #{ File.expand_path("../dummy/Rakefile", __FILE__) } challah_engine:install:migrations`
`rake --rakefile #{ File.expand_path("../dummy/Rakefile", __FILE__) } db:migrate db:test:prepare`

require "rspec/rails"
require "factory_girl"
require "challah/test"

# Load support files
Dir["#{ File.dirname(__FILE__) }/support/**/*.rb"].each { |f| require f }
Dir["#{ File.dirname(__FILE__) }/factories/**/*.rb"].each { |f| require f }

RSpec.configure do |config|
config.fixture_path = "#{ ::Rails.root }/spec/fixtures"
config.use_transactional_fixtures = true
Expand Down

0 comments on commit 3e03e68

Please sign in to comment.