Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated guard & rspec configuration

  • Loading branch information...
commit 880dbc83c7a79a8bb4d96e9bab572af0b9b7a752 1 parent 868a7ea
@szemek authored
Showing with 16 additions and 3 deletions.
  1. +0 −1  Guardfile
  2. +16 −2 spec/spec_helper.rb
View
1  Guardfile
@@ -6,7 +6,6 @@ guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb') { :rspec }
- watch('test/test_helper.rb') { :test_unit }
watch('spec/support/')
end
View
18 spec/spec_helper.rb
@@ -10,6 +10,8 @@
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
+ require 'capybara/rails'
+ require 'capybara/rspec'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
@@ -31,7 +33,19 @@
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
- config.use_transactional_fixtures = true
+ config.use_transactional_fixtures = false
+
+ config.before(:suite) do
+ DatabaseCleaner.strategy = :truncation
+ end
+
+ config.before(:each) do
+ DatabaseCleaner.start
+ end
+
+ config.after(:each) do
+ DatabaseCleaner.clean
+ end
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
@@ -42,5 +56,5 @@
Spork.each_run do
# This code will be run each time you run your specs.
-
+ FactoryGirl.reload
end
Please sign in to comment.
Something went wrong with that request. Please try again.