Changes in Watir test to accomodate the AR backend

This commit is contained in:
Alexey Verkhovsky 2005-08-14 04:06:31 +00:00
parent f07d0e32c6
commit 4f7e5bca30

View file

@ -307,9 +307,9 @@ class InstikiController
startup_info = [68].pack('lx64') startup_info = [68].pack('lx64')
process_info = [0, 0, 0, 0].pack('llll') process_info = [0, 0, 0, 0].pack('llll')
clear_database
startup_command = startup_command =
"ruby #{RAILS_ROOT}/instiki.rb --storage #{prepare_storage} " + "ruby #{RAILS_ROOT}/instiki.rb --port #{INSTIKI_PORT} --environment development"
" --port #{INSTIKI_PORT} --environment development"
result = Win32API.new('kernel32.dll', 'CreateProcess', 'pplllllppp', 'L').call( result = Win32API.new('kernel32.dll', 'CreateProcess', 'pplllllppp', 'L').call(
nil, nil,
@ -323,11 +323,10 @@ class InstikiController
return self.new(process_id) return self.new(process_id)
end end
def self.prepare_storage def self.clear_database
storage_path = INSTIKI_ROOT + '/storage/e2e' ENV['RAILS_ENV'] = 'development'
FileUtils.rm_rf(storage_path) if File.exists? storage_path require INSTIKI_ROOT + '/config/environment.rb'
FileUtils.mkdir_p(storage_path) [Revision, Page, Web, System].each { |entity| entity.delete_all }
storage_path
end end
def initialize(pid) def initialize(pid)