Skip to content

Instantly share code, notes, and snippets.

@ck3g
Last active October 12, 2015 05:08
Show Gist options
  • Save ck3g/3975970 to your computer and use it in GitHub Desktop.
Save ck3g/3975970 to your computer and use it in GitHub Desktop.
default environment
config.generators do |g|
g.test_framework :rspec,
fixtures: true,
view_specs: false,
helper_specs: false,
routing_specs: false,
controller_specs: true,
request_specs: true
g.fixture_replacement :factory_girl, dir: "spec/factories"
end
common: &common
adapter: postgresql
encoding: unicode
pool: 5
development:
<<: *common
database: project_name_development
username: postgres
password: '123'
test:
<<: *common
database: project_name_test
username: postgres
password: '123'
production:
<<: *common
database: project_name_production
username: postgres
password: '123'
# Bullet configuration
config.after_initialize do
Bullet.enable = true
Bullet.alert = true
Bullet.bullet_logger = true
Bullet.console = true
Bullet.rails_logger = true
Bullet.add_footer = true
end
source 'https://rubygems.org'
gem 'rails', '4.1.1'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem "devise"
gem "haml-rails"
gem 'jquery-rails'
# gem "has_scope"
gem 'bootstrap-sass'
gem 'meta-tags', require: "meta_tags"
gem 'simple_form'
group :development do
gem "erb2haml"
gem "html2haml"
gem "rails_best_practices"
gem "thin"
gem "pry-rails"
gem "bullet"
gem "spring"
end
group :development, :test do
gem 'rspec-rails', '~> 2.12.2'
gem 'factory_girl_rails', '~> 4.1.0'
end
group :test do
gem "ffaker", "~> 1.15.0"
gem "launchy"
gem "capybara", "~> 2.0.2"
gem "database_cleaner"
gem "shoulda"
end
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = false
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = "random"
config.include FactoryGirl::Syntax::Methods
config.include Devise::TestHelpers, type: :controller
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
GC.disable
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
GC.enable
end
end
rails new . -T --database=postgresql --skip-bundle
rails generate simple_form:install --bootstrap
rake haml:replace_erbs
rails g rspec:install
rake db:mongoid:create_indexes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment