silverstripe-framework/tests/salad/step_definitions/db-fixture.rb
Sam Minnee bf935d5a5e MINOR: Clear out the test database in between each salad scenario. (from r109100)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112778 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 00:54:45 +00:00

32 lines
763 B
Ruby

def loadFixture(fileName)
if $baseURL and $browser then
$browser.goto $baseURL + "dev/tests/sessionloadyml?fixture=" + fileName + "&flush=1"
else
fail("No \$baseUrl or \$browser found")
end
end
def startSession
# Reset database
if $baseURL and $browser then
$browser.goto $baseURL + 'dev/tests/endsession'
else
fail("No \$baseUrl or \$browser found")
end
fileName = 'sapphire/tests/Bare.yml'
if $baseURL and $browser then
$browser.goto $baseURL + "dev/tests/startsession?fixture=" + fileName + "&flush=1"
else
fail("No \$baseUrl or \$browser found")
end
end
Given /load the fixture file "([^"]+)"/ do |fileName|
loadFixture(fileName)
end
startSession()
Before do
Given "I visit /dev/tests/emptydb?fixture=sapphire/tests/Bare.yml"
end