aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorAlban Peignier2012-04-19 10:43:54 +0200
committerAlban Peignier2012-04-19 10:43:54 +0200
commitd1a4fe434ff81de0a9db0cc4c5f9aab3c8b05eb7 (patch)
tree901ed968179ad136ae4da08d9049d238b290df24 /spec
parent31c3a945318d135850409e412c710ffbe2f599a7 (diff)
downloadchouette-core-d1a4fe434ff81de0a9db0cc4c5f9aab3c8b05eb7.tar.bz2
Load explicitely FactoryGirl if needed. Ignore errors when dropping Apartment::Databases. Refs #13
Diffstat (limited to 'spec')
-rw-r--r--spec/spec_helper.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 1caf5560b..ba28c1557 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -8,6 +8,12 @@ require 'rspec/autorun'
require 'capybara/rspec'
require 'capybara/rails'
+# FIXME FactoryGirl not found in jenkins build #13
+unless defined?(FactoryGirl)
+ require 'factory_girl'
+ require 'spec/factories.rb'
+end
+
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
@@ -41,9 +47,14 @@ RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
- Apartment.database_names.each do |database|
- Apartment::Database.drop(database)
+ begin
+ Apartment.database_names.each do |database|
+ Apartment::Database.drop(database)
+ end
+ rescue
+ # FIXME referentials table not found in jenkins build #13
end
+
DatabaseCleaner.clean_with(:truncation, {:except => %w[spatial_ref_sys geometry_columns]} )
end