Skip to content

Instantly share code, notes, and snippets.

@lukemorton
Last active April 5, 2016 17:18
Show Gist options
  • Save lukemorton/cf6a3054d81abc34d21e8e01eb2c03f7 to your computer and use it in GitHub Desktop.
Save lukemorton/cf6a3054d81abc34d21e8e01eb2c03f7 to your computer and use it in GitHub Desktop.
--require spec_helper
--color
source 'https://rubygems.org'
gem 'rails', '4.2.4'
group :test do
gem 'brakeman' # Always latest
gem 'cane', '2.6.2'
gem 'capybara', '2.4.1'
gem 'database_cleaner', '1.5.1'
gem 'factory_girl', '4.5.0'
gem 'ffaker', '1.32.1'
gem 'rspec-its', '1.0.1'
gem 'rspec-rails', '3.2.1'
gem 'rspec', '3.2.0'
gem 'scss-lint', '~> 0.37.0'
gem 'tailor', '1.4.1'
end
group :development do
gem 'spring'
gem 'quiet_assets'
end
group :development, :test do
gem 'dotenv-rails'
gem 'pry-byebug'
gem 'pry-rails'
end
require File.join(File.dirname(__FILE__), 'support/rails')
require 'json'
require 'webmock/rspec'
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
RSpec.configure do |config|
config.filter_run :focus
config.run_all_when_everything_filtered = true
config.infer_spec_type_from_file_location!
if config.files_to_run.one?
config.default_formatter = 'doc'
end
config.profile_examples = 5
config.order = :random
Kernel.srand config.seed
config.expect_with :rspec do |expectations|
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.syntax = :expect
mocks.verify_partial_doubles = true
end
config.before :example do
ActionMailer::Base.deliveries.clear
end
end
require 'capybara/rails'
require 'capybara/rspec'
require 'database_cleaner'
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.before(:each) do
DatabaseCleaner.clean_with(:truncation)
end
end
require 'factory_girl'
FactoryGirl.definition_file_paths << File.join('spec', 'factories')
FactoryGirl.find_definitions
RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
end
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../../config/environment', __FILE__)
require 'rspec/rails'
include ActionDispatch::TestProcess
ActiveRecord::Migration.maintain_test_schema!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment