2015-08-23 14:29:09 +00:00
|
|
|
ENV["RAILS_ENV"] ||= "test"
|
|
|
|
|
|
|
|
require "codeclimate-test-reporter"
|
|
|
|
require "simplecov"
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-03-25 21:58:51 +00:00
|
|
|
CodeClimate::TestReporter.start
|
2015-08-23 14:29:09 +00:00
|
|
|
SimpleCov.start "rails"
|
2014-03-23 00:22:25 +00:00
|
|
|
|
|
|
|
require File.expand_path("../../config/environment", __FILE__)
|
2015-08-23 14:29:09 +00:00
|
|
|
require "rspec/rails"
|
|
|
|
require "capybara/rspec"
|
|
|
|
require "capybara/poltergeist"
|
|
|
|
|
|
|
|
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-03-30 19:50:52 +00:00
|
|
|
Capybara.register_driver :poltergeist do |app|
|
2014-04-06 14:23:17 +00:00
|
|
|
Capybara::Poltergeist::Driver.new(app,
|
2014-08-10 20:55:44 +00:00
|
|
|
timeout: 30,
|
2015-08-23 14:29:09 +00:00
|
|
|
phantomjs_logger: File.open("/dev/null")
|
2014-04-06 14:23:17 +00:00
|
|
|
)
|
2014-03-30 19:50:52 +00:00
|
|
|
end
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2015-08-23 14:29:09 +00:00
|
|
|
Capybara.configure do |config|
|
|
|
|
config.default_wait_time = 5
|
|
|
|
config.javascript_driver = :poltergeist
|
|
|
|
end
|
2014-03-30 19:50:52 +00:00
|
|
|
|
2014-03-23 00:22:25 +00:00
|
|
|
RSpec.configure do |config|
|
|
|
|
config.include FactoryGirl::Syntax::Methods
|
2014-03-30 19:50:52 +00:00
|
|
|
config.include Controllers::JsonHelpers, type: :controller
|
|
|
|
config.include Features::FormHelpers, type: :feature
|
2015-05-14 16:27:12 +00:00
|
|
|
config.include Features::ServerHelpers, type: :feature
|
2014-03-30 19:50:52 +00:00
|
|
|
config.include Features::SessionHelpers, type: :feature
|
|
|
|
|
2014-03-23 00:22:25 +00:00
|
|
|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
2015-08-23 14:29:09 +00:00
|
|
|
config.order = :random
|
2014-03-30 19:50:52 +00:00
|
|
|
config.use_transactional_fixtures = false
|
2015-05-02 22:46:16 +00:00
|
|
|
config.color = true
|
|
|
|
config.formatter = :documentation
|
2015-08-15 11:50:28 +00:00
|
|
|
config.infer_spec_type_from_file_location!
|
2014-03-23 00:22:25 +00:00
|
|
|
end
|