2013-09-09 22:56:17 +04:00
|
|
|
ENV['RAILS_ENV'] = ENV['RACK_ENV'] = 'test'
|
|
|
|
|
2012-05-06 22:50:46 +04:00
|
|
|
$:.unshift("#{File.dirname(__FILE__)}/..")
|
2014-03-26 11:57:15 +04:00
|
|
|
require File.expand_path('dummy_rails/config/environment', File.dirname(__FILE__))
|
2012-05-06 22:50:46 +04:00
|
|
|
|
2014-06-24 06:21:14 +04:00
|
|
|
require 'test-unit'
|
2012-05-06 22:50:46 +04:00
|
|
|
|
|
|
|
require 'sass'
|
2013-09-09 22:56:17 +04:00
|
|
|
|
|
|
|
require 'rails/test_help'
|
|
|
|
|
|
|
|
Dir[File.expand_path("./support/**/*.rb", File.dirname(__FILE__))].each { |f| require f }
|
|
|
|
|
|
|
|
#= Capybara + Poltergeist
|
|
|
|
require 'capybara/rails'
|
|
|
|
require 'capybara/poltergeist'
|
2014-06-17 00:40:40 +04:00
|
|
|
|
|
|
|
Capybara.register_driver :poltergeist do |app|
|
|
|
|
Capybara::Poltergeist::Driver.new(
|
|
|
|
app,
|
|
|
|
# inspector: '/Applications/Chromium.app/Contents/MacOS/Chromium', # open in inspector: page.driver.debug
|
|
|
|
window_size: [1280, 1024],
|
|
|
|
js_errors: true, debug: true
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2013-09-09 22:56:17 +04:00
|
|
|
Capybara.configure do |config|
|
|
|
|
config.app_host = 'http://localhost:7000'
|
|
|
|
config.default_driver = :poltergeist
|
|
|
|
config.javascript_driver = :poltergeist
|
|
|
|
config.server_port = 7000
|
|
|
|
config.default_wait_time = 10
|
|
|
|
end
|
2014-06-17 00:40:40 +04:00
|
|
|
|