Last active
November 20, 2017 22:31
-
-
Save faouzzz/e55360f5322f344f8778130a4786f8d4 to your computer and use it in GitHub Desktop.
Rails Gemfile with test and guard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile - https://git.io/vDW2B | |
source 'https://rubygems.org' | |
git_source(:github) do |repo_name| | |
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/') | |
"https://github.com/#{repo_name}.git" | |
end | |
gem 'rails', '~> 5.1.4' | |
gem 'puma', '~> 3.0' | |
gem 'sqlite3' | |
#gem 'pg' | |
#gem 'mysql2' | |
#gem 'activerecord-sqlserver-adapter' | |
#gem 'tiny_tds' | |
gem 'sass-rails', '~> 5.0' | |
gem 'uglifier', '~> 1.3.0' | |
#gem 'coffee-rails', '~> 4.2' | |
gem 'jquery-rails' | |
gem 'turbolinks', '~> 5' | |
gem 'jbuilder', '~> 2.5' | |
# gem 'bcrypt, '~> 3.1.7' | |
gem 'rails-i18n' | |
gem 'devise' | |
# gem 'devise_ldap_authenticatable' | |
gem 'devise-i18n' | |
gem 'cancancan' | |
gem 'haml-rails' | |
gem 'simple_form' | |
gem 'semantic-ui-sass' | |
gem 'autoprefixer-rails' | |
#gem 'carrierwave' | |
#gem 'chartkick' | |
group :development do | |
gem 'i18n-tasks', '~> 0.9.11' | |
#gem 'i18n_yaml_generator' | |
gem 'i18n_generators' | |
gem 'dotenv-rails' | |
#gem 'capistrano-rails' | |
#gem 'capistrano-rvm' | |
end | |
group :development, :test do | |
#gem 'better_errors' | |
#gem 'binding_of_caller' | |
# gem 'quiet_assets' #rails < 5 only | |
gem 'pry-rails' | |
gem 'pry-byebug' | |
gem 'web-console' | |
#gem 'bullet', '~> 5.0' | |
gem 'spring' | |
gem 'faker', require: false | |
gem 'guard', '>= 2.2.2', :require => false | |
gem 'guard-rspec', :require => false | |
end | |
group :test do | |
gem 'rspec-rails' | |
gem 'shoulda-context' | |
gem 'shoulda-matchers', '>= 3.0.1' | |
gem 'capybara' | |
gem 'poltergeist' | |
gem 'factory_girl' | |
#gem 'simplecov' | |
end | |
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard :rspec, :spring => true do | |
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_test.rb" } | |
watch(%r{^app/controllers/application_controller\.rb$}) { "test/controllers" } | |
watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "spec/integration/#{m[1]}_test.rb" } | |
watch(%r{^app/views/(.+)_mailer/.+}) { |m| "spec/mailers/#{m[1]}_mailer_test.rb" } | |
watch(%r{^app/workers/(.+)\.rb$}) { |m| "test/unit/workers/#{m[1]}_test.rb" } | |
watch(%r{^lib/(.+)\.rb$}) { |m| "test/unit/lib/#{m[1]}_test.rb" } | |
watch(%r{^lib/tasks/(.+)\.rake$}) { |m| "test/unit/lib/tasks/#{m[1]}_test.rb" } | |
watch(%r{^test/.+_test\.rb$}) | |
watch(%r{^test/test_helper\.rb$}) { "test" } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test/test_helper.rb | |
require 'faker' | |
# Improved Minitest output (color and progress bar) | |
require "minitest/reporters" | |
Minitest::Reporters.use!( | |
Minitest::Reporters::ProgressReporter.new(detailed_skip: false), | |
ENV, | |
Minitest.backtrace_filter | |
) | |
Faker::Config.locale = 'fr-FR' | |
# Capybara and poltergeist integration | |
require "capybara/rails" | |
require "capybara/poltergeist" | |
Capybara.javascript_driver = :poltergeist | |
class ActiveSupport::TestCase | |
# fixtures :all | |
include FactoryGirl::Syntax::Methods | |
end | |
class ActionController::TestCase | |
# include Devise::Test::ControllerHelpers | |
end | |
class ActionDispatch::IntegrationTest | |
include Capybara::DSL | |
# include Devise::Test::IntegrationHelpers | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment