fix more junk
This commit is contained in:
parent
24f2bf7965
commit
2efd5eb0fb
@ -9,7 +9,7 @@ module VegetableGlue
|
||||
CLEAN = '__clean__'
|
||||
|
||||
class << self
|
||||
attr_accessor :url, :path, :env
|
||||
attr_accessor :url, :path, :env, :cleaning_style
|
||||
|
||||
def shutdown
|
||||
Runner.new(options).shutdown
|
||||
|
@ -5,6 +5,8 @@ Before do |scenario|
|
||||
ENV.delete('REGLUE')
|
||||
end
|
||||
|
||||
VegetableGlue.clean(scenario.to_sexp[3])
|
||||
@scenario = scenario
|
||||
|
||||
VegetableGlue.clean(@scenario.to_sexp[3])
|
||||
end
|
||||
|
||||
|
@ -10,10 +10,13 @@ class ActionDispatch::Routing::Mapper
|
||||
get VegetableGlue::CLEAN => lambda { |env|
|
||||
require 'database_cleaner'
|
||||
|
||||
DatabaseCleaner.clean_with :truncation
|
||||
params = Hash[URI.decode_www_form(env['QUERY_STRING'])]
|
||||
|
||||
if scenario_name = URI.decode_www_form(env['QUERY_STRING']).first
|
||||
Rails.logger.info "Cleaning database for #{scenario_name.last}"
|
||||
DatabaseCleaner.clean_with :truncation
|
||||
DatabaseCleaner.clean_with :deletion
|
||||
|
||||
if params[:scenario]
|
||||
Rails.logger.info "Cleaning database for #{params[:scenario]}"
|
||||
end
|
||||
|
||||
[ 200, {}, [ VegetableGlue::CLEAN ] ]
|
||||
|
Loading…
Reference in New Issue
Block a user