8000 GitHub - adrienpoly/rails-templates: Jump start your Rails development with Le Wagon best practices
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Jump start your Rails development with Le Wagon best practices

License

Notifications You must be signed in to change notification settings

adrienpoly/rails-templates

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rails Templates

Quickly generate a rails app with the following configuration:

  • devise
  • bootstrap
  • font awesome
  • material kit
  • rspec & the gang
  • guard
  • rubocop

## Devise


```bash
gem install rails -v 5.0.5 # Maybe you already have it :)
rails new \
  -T --database postgresql \
  -m https://raw.githubusercontent.com/adrienpoly/rails-templates/master/devise.rb \
  CHANGE_THIS_TO_YOUR_RAILS_APP_NAME

Testing

These templates are generated without a test folder (thanks to the -T flag). Starting from here, you can add Minitest & Capybara with the following procedure:

# config/application.rb
require "rails/test_unit/railtie" # Un-comment this line
# In the terminal, run:
folders=(controllers fixtures helpers integration mailers models)
for dir in "${folders[@]}"; do mkdir -p "test/$dir" && touch "test/$dir/.keep"; done
cat >test/test_helper.rb <<RUBY
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

class ActiveSupport::TestCase
  fixtures :all
end
RUBY
brew install phantomjs  # on OSX only
                        # Linux: see https://gist.github.com/julionc/7476620
# Gemfile
group :development, :test do
  gem 'capybara'
  gem 'poltergeist'
  gem 'launchy'
  gem 'minitest-reporters'
  # [...]
end
bundle install
# test/test_helper.rb
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/reporters'
Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new]

class ActiveSupport::TestCase
  fixtures :all
end

require 'capybara/rails'
class ActionDispatch::IntegrationTest
  include Capybara::DSL
  def teardown
    Capybara.reset_sessions!
    Capybara.use_default_driver
    Warden.test_reset!
  end
end

require 'capybara/poltergeist'
Capybara.default_driver = :poltergeist

include Warden::Test::Helpers
Warden.test_mode!

About

Jump start your Rails development with Le Wagon best practices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 70.1%
  • HTML 29.9%
0