Created
October 19, 2012 06:25
-
-
Save Slike9/3916517 to your computer and use it in GitHub Desktop.
integration_spec_helper.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'capybara/rails' | |
require 'capybara/rspec' | |
require 'headless' | |
RSpec.configure do |config| | |
config.use_transactional_fixtures = false | |
Capybara.javascript_driver = :webkit | |
Capybara.default_host = '127.0.0.1' | |
Capybara.server_port = 30009 | |
Capybara.app_host = "http://test.host:30009" | |
Capybara.server_boot_timeout = 60 | |
Capybara.default_wait_time = 10 | |
# jenkins и обычный пользователь пускают X-ы на разных портах | |
headless = Headless.new :destroy_at_exit => false, :display => `whoami`=~/jenkins/ ? 98 : 99 | |
headless.start | |
config.before :each do | |
if example.metadata[:js] | |
DatabaseCleaner.strategy = :truncation | |
else | |
DatabaseCleaner.strategy = :transaction | |
DatabaseCleaner.start | |
end | |
end | |
config.after :each do | |
DatabaseCleaner.clean | |
if example.metadata[:js] | |
load "#{Rails.root}/db/seeds.rb" | |
end | |
end | |
config.include BestInPlace::TestHelpers | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment