From 4f7e5bca30a10320a33501ad8148331c9da70653 Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Sun, 14 Aug 2005 04:06:31 +0000 Subject: [PATCH] Changes in Watir test to accomodate the AR backend --- test/watir/e2e.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/watir/e2e.rb b/test/watir/e2e.rb index 90cb9af3..8db2c36e 100644 --- a/test/watir/e2e.rb +++ b/test/watir/e2e.rb @@ -307,9 +307,9 @@ class InstikiController startup_info = [68].pack('lx64') process_info = [0, 0, 0, 0].pack('llll') + clear_database startup_command = - "ruby #{RAILS_ROOT}/instiki.rb --storage #{prepare_storage} " + - " --port #{INSTIKI_PORT} --environment development" + "ruby #{RAILS_ROOT}/instiki.rb --port #{INSTIKI_PORT} --environment development" result = Win32API.new('kernel32.dll', 'CreateProcess', 'pplllllppp', 'L').call( nil, @@ -323,11 +323,10 @@ class InstikiController return self.new(process_id) end - def self.prepare_storage - storage_path = INSTIKI_ROOT + '/storage/e2e' - FileUtils.rm_rf(storage_path) if File.exists? storage_path - FileUtils.mkdir_p(storage_path) - storage_path + def self.clear_database + ENV['RAILS_ENV'] = 'development' + require INSTIKI_ROOT + '/config/environment.rb' + [Revision, Page, Web, System].each { |entity| entity.delete_all } end def initialize(pid)