2014-06-07 04:09:56 -04:00
|
|
|
# RSpec.configure do |config|
|
|
|
|
|
|
|
|
# config.around(:each) do |example|
|
|
|
|
# DatabaseCleaner.strategy = :transaction
|
|
|
|
# DatabaseCleaner.clean_with(:truncation)
|
|
|
|
# DatabaseCleaner.cleaning do
|
|
|
|
# example.run
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
|
|
|
|
# config.around(:each, js: true) do |example|
|
|
|
|
# DatabaseCleaner.strategy = :truncation
|
|
|
|
# DatabaseCleaner.clean_with(:truncation)
|
|
|
|
# DatabaseCleaner.cleaning do
|
|
|
|
# example.run
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
# end
|
2014-06-05 14:21:28 -04:00
|
|
|
RSpec.configure do |config|
|
2014-06-07 04:09:56 -04:00
|
|
|
config.before(:suite) do
|
|
|
|
DatabaseCleaner.clean_with(:truncation)
|
|
|
|
end
|
2014-06-06 02:01:17 -04:00
|
|
|
|
2014-06-07 04:09:56 -04:00
|
|
|
config.before(:each) do
|
2014-06-06 02:01:17 -04:00
|
|
|
DatabaseCleaner.strategy = :transaction
|
|
|
|
end
|
|
|
|
|
2014-06-07 04:09:56 -04:00
|
|
|
config.before(:each, :js => true) do
|
2014-06-06 02:01:17 -04:00
|
|
|
DatabaseCleaner.strategy = :truncation
|
2014-06-07 04:09:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
config.before(:each) do
|
|
|
|
DatabaseCleaner.start
|
|
|
|
end
|
|
|
|
|
|
|
|
config.after(:each) do
|
|
|
|
DatabaseCleaner.clean
|
2012-08-23 05:19:40 -04:00
|
|
|
end
|
2015-02-12 13:17:35 -05:00
|
|
|
|
|
|
|
# rspec-rails 3 will no longer automatically infer an example group's spec type
|
|
|
|
# from the file location. You can explicitly opt-in to the feature using this
|
|
|
|
# config option.
|
|
|
|
# To explicitly tag specs without using automatic inference, set the `:type`
|
|
|
|
# metadata manually:
|
|
|
|
#
|
|
|
|
# describe ThingsController, :type => :controller do
|
|
|
|
# # Equivalent to being in spec/controllers
|
|
|
|
# end
|
|
|
|
config.infer_spec_type_from_file_location!
|
2012-08-23 05:19:40 -04:00
|
|
|
end
|