aboutsummaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorLuc Donnet2012-02-20 22:44:44 +0100
committerLuc Donnet2012-02-20 22:44:44 +0100
commitda3e849d4d89ffa3de2d370a30d3d5531b50ea5b (patch)
tree26d0e12a135753d0acf4a59a7007006aac5e759a /spec/spec_helper.rb
parenta0823f387ddea69b0f207ba35165fcfd13b169d3 (diff)
downloadchouette-core-da3e849d4d89ffa3de2d370a30d3d5531b50ea5b.tar.bz2
Add requests spec, Fix view
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 41ce1fde6..bb5f59026 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -3,12 +3,14 @@ ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
+require 'capybara/rspec'
# 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}
RSpec.configure do |config|
+ DatabaseCleaner.logger = Rails.logger
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
@@ -30,4 +32,17 @@ RSpec.configure do |config|
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
+ config.before(:suite) do
+ DatabaseCleaner.strategy = :transaction
+ DatabaseCleaner.clean_with( :truncation, {:except => %w[spatial_ref_sys geometry_columns]} )
+ end
+
+ config.before(:each) do
+ DatabaseCleaner.start
+ end
+
+ config.after(:each) do
+ DatabaseCleaner.clean
+ end
+
end