Commit 5949e302 authored by Andrew8xx8's avatar Andrew8xx8

Spork support added

parent 90db28d6
--colour --colour --drb
...@@ -173,6 +173,8 @@ group :development, :test do ...@@ -173,6 +173,8 @@ group :development, :test do
# PhantomJS driver for Capybara # PhantomJS driver for Capybara
gem 'poltergeist', '1.1.0' gem 'poltergeist', '1.1.0'
gem 'spork', '~> 1.0rc'
end end
group :test do group :test do
......
...@@ -447,6 +447,7 @@ GEM ...@@ -447,6 +447,7 @@ GEM
capybara (~> 2.0.0) capybara (~> 2.0.0)
railties (>= 3) railties (>= 3)
spinach (>= 0.4) spinach (>= 0.4)
spork (1.0.0rc3)
sprockets (2.2.2) sprockets (2.2.2)
hike (~> 1.2) hike (~> 1.2)
multi_json (~> 1.0) multi_json (~> 1.0)
...@@ -574,6 +575,7 @@ DEPENDENCIES ...@@ -574,6 +575,7 @@ DEPENDENCIES
six six
slim slim
spinach-rails (= 0.2.0) spinach-rails (= 0.2.0)
spork (~> 1.0rc)
stamp stamp
state_machine state_machine
test_after_commit test_after_commit
......
require 'simplecov' unless ENV['CI'] require 'rubygems'
require 'spork'
if ENV['TRAVIS'] Spork.prefork do
require 'coveralls' require 'simplecov' unless ENV['CI']
Coveralls.wear!
end if ENV['TRAVIS']
require 'coveralls'
Coveralls.wear!
end
# This file is copied to spec/ when you run 'rails generate rspec:install' # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test' ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__) require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails' require 'rspec/rails'
require 'capybara/rails' require 'capybara/rails'
require 'capybara/rspec' require 'capybara/rspec'
require 'webmock/rspec' require 'webmock/rspec'
require 'email_spec' require 'email_spec'
require 'sidekiq/testing/inline' require 'sidekiq/testing/inline'
require 'capybara/poltergeist' require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
Capybara.default_wait_time = 10 # Loading more in this block will cause your tests to run faster. However,
# Requires supporting ruby files with custom matchers and macros, etc, # if you change any configuration or code from libraries loaded here, you'll
# in spec/support/ and its subdirectories. # need to restart spork for it take effect.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} Capybara.javascript_driver = :poltergeist
Capybara.default_wait_time = 10
WebMock.disable_net_connect!(allow_localhost: true)
# Requires supporting ruby files with custom matchers and macros, etc,
RSpec.configure do |config| # in spec/support/ and its subdirectories.
config.mock_with :rspec Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
config.include LoginHelpers, type: :feature WebMock.disable_net_connect!(allow_localhost: true)
config.include LoginHelpers, type: :request
config.include FactoryGirl::Syntax::Methods RSpec.configure do |config|
config.include Devise::TestHelpers, type: :controller config.mock_with :rspec
# If you're not using ActiveRecord, or you'd prefer not to run each of your config.include LoginHelpers, type: :feature
# examples within a transaction, remove the following line or assign false config.include LoginHelpers, type: :request
# instead of true. config.include FactoryGirl::Syntax::Methods
config.use_transactional_fixtures = false config.include Devise::TestHelpers, type: :controller
config.before do # If you're not using ActiveRecord, or you'd prefer not to run each of your
# Use tmp dir for FS manipulations # examples within a transaction, remove the following line or assign false
temp_repos_path = Rails.root.join('tmp', 'test-git-base-path') # instead of true.
Gitlab.config.gitlab_shell.stub(repos_path: temp_repos_path) config.use_transactional_fixtures = false
FileUtils.rm_rf temp_repos_path
FileUtils.mkdir_p temp_repos_path config.before do
# Use tmp dir for FS manipulations
temp_repos_path = Rails.root.join('tmp', 'test-git-base-path')
Gitlab.config.gitlab_shell.stub(repos_path: temp_repos_path)
FileUtils.rm_rf temp_repos_path
FileUtils.mkdir_p temp_repos_path
end
end end
end end
Spork.each_run do
# This code will be run each time you run your specs.
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment