Skip to content

Instantly share code, notes, and snippets.

@cherring
Created March 23, 2011 23:59
Show Gist options
  • Select an option

  • Save cherring/884299 to your computer and use it in GitHub Desktop.

Select an option

Save cherring/884299 to your computer and use it in GitHub Desktop.
Before do
Capybara.default_host = 'example.com'
DatabaseCleaner.start
end
After do
DatabaseCleaner.clean
FileUtils.rm_r(Dir.glob("#{Rails.root}/tmp/uploads/*"))
FileUtils.rm_r(Dir.glob("#{Rails.root}/uploads/test*"))
FileUtils.rm_r(Dir.glob("#{Rails.root}/public/uploads/tmp/*"))
end
Given /^I visit the subdomain for my account$/ do
Capybara.default_host = "#{@account.subdomain}.example.com"
Capybara.app_host = "http://#{@account.subdomain}.example.com:9887" if Capybara.current_driver == :culerity
end
Given /^I visit the subdomain for the second account$/ do
Capybara.default_host = "#{@second_account.subdomain}.example.com"
Capybara.app_host = "http://#{@second_account.subdomain}.example.com:9887" if Capybara.current_driver == :culerity
end
Given /^I visit a subdomain that isn't assigned to an Account$/ do
Capybara.default_host = "#{@account.subdomain}-1.example.com"
Capybara.app_host = "http://#{@accounnt.subdomain}-1.example.com:9887" if Capybara.current_driver == :culerity
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment