kratos 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +11 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE +21 -0
  7. data/README.md +24 -0
  8. data/bin/kratos +18 -0
  9. data/bin/rake +16 -0
  10. data/bin/rspec +16 -0
  11. data/bin/setup +14 -0
  12. data/kratos.gemspec +30 -0
  13. data/lib/kratos/actions.rb +31 -0
  14. data/lib/kratos/app_builder.rb +468 -0
  15. data/lib/kratos/generators/app_generator.rb +164 -0
  16. data/lib/kratos/version.rb +6 -0
  17. data/lib/kratos.rb +4 -0
  18. data/templates/Capfile +15 -0
  19. data/templates/Gemfile.erb +67 -0
  20. data/templates/Procfile +2 -0
  21. data/templates/README.md.erb +29 -0
  22. data/templates/_javascript.html.erb +10 -0
  23. data/templates/acceptance_helpers_rspec.rb +18 -0
  24. data/templates/action_mailer.rb +5 -0
  25. data/templates/application.scss +4 -0
  26. data/templates/bin_setup +25 -0
  27. data/templates/brakeman.rake +9 -0
  28. data/templates/bundler_audit.rake +12 -0
  29. data/templates/cap_environment.rb +1 -0
  30. data/templates/capybara_poltergeist.rb +17 -0
  31. data/templates/circle.yml.erb +9 -0
  32. data/templates/config_locales_en_datetime.yml +107 -0
  33. data/templates/config_locales_en_messages.yml.erb +3 -0
  34. data/templates/config_locales_pt-BR_datetime.yml +108 -0
  35. data/templates/config_locales_pt-BR_messages.yml.erb +4 -0
  36. data/templates/database_cleaner_rspec.rb +21 -0
  37. data/templates/deploy.rake +28 -0
  38. data/templates/deploy_config.rb.erb +33 -0
  39. data/templates/dev.rake +12 -0
  40. data/templates/disable_xml_params.rb +1 -0
  41. data/templates/dotfiles/.ctags +2 -0
  42. data/templates/dotfiles/.gitignore +14 -0
  43. data/templates/dotfiles/.sample.application.yml +15 -0
  44. data/templates/errors.rb +34 -0
  45. data/templates/factory_girl_rspec.rb +3 -0
  46. data/templates/foreman.rake +39 -0
  47. data/templates/i18n-tasks.yml +22 -0
  48. data/templates/i18n.rb +3 -0
  49. data/templates/i18n_rspec.rb +19 -0
  50. data/templates/json_encoding.rb +1 -0
  51. data/templates/kratos_layout.html.erb.erb +20 -0
  52. data/templates/lograge.rb +14 -0
  53. data/templates/postgresql_database.yml.erb +22 -0
  54. data/templates/puma.rb +28 -0
  55. data/templates/rails_helper.rb +28 -0
  56. data/templates/redis.rb +10 -0
  57. data/templates/rspec_api_documentation_rspec.rb.erb +33 -0
  58. data/templates/rubocop.rake +4 -0
  59. data/templates/rubocop.yml +40 -0
  60. data/templates/schedule.rb +8 -0
  61. data/templates/secrets.yml +14 -0
  62. data/templates/shoulda_matchers_config_rspec.rb +6 -0
  63. data/templates/sidekiq.yml +4 -0
  64. data/templates/sidekiq_rspec.yml +10 -0
  65. data/templates/sidekiq_security.rb +6 -0
  66. data/templates/smtp.rb +9 -0
  67. data/templates/spec_helper.rb +31 -0
  68. data/templates/staging.rb +5 -0
  69. data/templates/timezones.rb +26 -0
  70. metadata +145 -0
@@ -0,0 +1,164 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/rails/app/app_generator'
3
+
4
+ module Kratos
5
+ class AppGenerator < Rails::Generators::AppGenerator
6
+ class_option :database, type: :string, aliases: '-d', default: 'postgresql',
7
+ desc: "Configure for selected database (options: #{DATABASES.join('/')})"
8
+
9
+ class_option :skip_test_unit, type: :boolean, aliases: '-T', default: true,
10
+ desc: 'Skip Test::Unit files'
11
+
12
+ class_option :skip_turbolinks, type: :boolean, default: true,
13
+ desc: 'Skip turbolinks gem'
14
+
15
+ class_option :skip_bundle, type: :boolean, aliases: '-B', default: true,
16
+ desc: "Don't run bundle install"
17
+
18
+ def finish_template
19
+ invoke :kratos_customization
20
+ super
21
+ end
22
+
23
+ def kratos_customization
24
+ invoke :customize_gemfile
25
+ invoke :setup_development_environment
26
+ invoke :setup_test_environment
27
+ invoke :setup_production_environment
28
+ invoke :setup_staging_environment
29
+ invoke :setup_secret_token
30
+ invoke :create_views
31
+ invoke :configure_app
32
+ invoke :setup_stylesheets
33
+ invoke :setup_git
34
+ invoke :setup_database
35
+ invoke :setup_capistrano
36
+ invoke :setup_quality_control
37
+ end
38
+
39
+ def customize_gemfile
40
+ build :replace_gemfile
41
+ build :set_ruby_to_version_being_used
42
+
43
+ bundle_command 'install'
44
+ end
45
+
46
+ def setup_development_environment
47
+ say 'Setting up the development environment'
48
+ build :raise_on_missing_assets_in_test
49
+ build :raise_on_delivery_errors
50
+ build :set_test_delivery_method
51
+ build :add_bullet_gem_configuration
52
+ build :raise_on_unpermitted_parameters
53
+ build :provide_setup_script
54
+ build :provide_dev_prime_task
55
+ build :configure_generators
56
+ build :configure_i18n_for_missing_translations
57
+ build :configure_quiet_assets
58
+ end
59
+
60
+ def setup_test_environment
61
+ say 'Setting up the test environment'
62
+ build :set_up_factory_girl_for_rspec
63
+ build :create_factories_directory
64
+ build :generate_rspec
65
+ build :configure_rspec
66
+ build :enable_database_cleaner
67
+ build :provide_shoulda_matchers_config
68
+ build :configure_spec_support_features
69
+ build :configure_ci
70
+ build :configure_i18n_for_test_environment
71
+ build :configure_action_mailer_in_specs
72
+ build :configure_capybara_poltergeist
73
+ build :configure_rspec_api_documentation
74
+ build :configure_acceptance_helpers
75
+ build :configure_i18n_tasks
76
+ end
77
+
78
+ def setup_production_environment
79
+ say 'Setting up the production environment'
80
+ build :configure_smtp
81
+ build :enable_rack_deflater
82
+ build :setup_asset_host
83
+ build :configure_lograge
84
+ build :setup_dalli_cache
85
+ end
86
+
87
+ def setup_staging_environment
88
+ say 'Setting up the staging environment'
89
+ build :setup_staging_environment
90
+ end
91
+
92
+ def setup_secret_token
93
+ say 'Moving secret token out of version control'
94
+ build :setup_secret_token
95
+ end
96
+
97
+ def create_views
98
+ say 'Creating views'
99
+ build :create_partials_directory
100
+ build :create_shared_javascripts
101
+ build :create_application_layout
102
+ end
103
+
104
+ def configure_app
105
+ say 'Configuring app'
106
+ build :copy_dotfiles
107
+ build :configure_default_url_options
108
+ build :configure_action_mailer
109
+ build :configure_redis
110
+ build :configure_sidekiq
111
+ build :configure_routes
112
+ build :configure_time_formats
113
+ build :configure_i18n_messages
114
+ build :configure_whenever
115
+ build :configure_app_services
116
+ build :setup_brazilian_app
117
+ build :setup_dalli_store
118
+ build :disable_xml_params
119
+ build :copy_miscellaneous_files
120
+ build :fix_i18n_deprecation_warning
121
+ build :setup_default_rake_task
122
+ build :configure_puma
123
+ build :set_up_forego
124
+ build :customize_error_pages
125
+ build :remove_config_comment_lines
126
+ end
127
+
128
+ def setup_stylesheets
129
+ say 'Set up stylesheets'
130
+ build :setup_stylesheets
131
+ end
132
+
133
+ def setup_git
134
+ return if options[:skip_git]
135
+
136
+ say 'Initializing git'
137
+ build :init_git
138
+ end
139
+
140
+ def setup_database
141
+ say 'Setting up database'
142
+
143
+ build :use_postgres_config_template if 'postgresql' == options[:database]
144
+
145
+ build :create_database
146
+ end
147
+
148
+ def setup_capistrano
149
+ say 'Setting up Capistrano'
150
+
151
+ build :create_capistrano_tasks
152
+ build :create_capfile
153
+ build :create_capistrano_config
154
+ build :create_capistrano_environments
155
+ end
156
+
157
+ def setup_quality_control
158
+ say 'Setting up quality control tools'
159
+ build :setup_bundler_audit
160
+ build :setup_rubocop
161
+ build :setup_brakeman
162
+ end
163
+ end
164
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ module Kratos
3
+ RAILS_VERSION = '~> 4.2.0'.freeze
4
+ RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
5
+ VERSION = '1.0.0'.freeze
6
+ end
data/lib/kratos.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'kratos/version'
2
+ require 'kratos/generators/app_generator'
3
+ require 'kratos/actions'
4
+ require 'kratos/app_builder'
data/templates/Capfile ADDED
@@ -0,0 +1,15 @@
1
+ # Load DSL and set up stages
2
+ require 'capistrano/setup'
3
+
4
+ # Include default deployment tasks
5
+ require 'capistrano/deploy'
6
+ require 'capistrano/rbenv'
7
+ require 'capistrano/bundler'
8
+ require 'capistrano/rails/migrations'
9
+ require 'capistrano/rails/assets'
10
+
11
+ # Setup Whenever tasks
12
+ require 'whenever/capistrano'
13
+
14
+ # Load custom tasks from `lib/capistrano/tasks` if you have any defined
15
+ Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
@@ -0,0 +1,67 @@
1
+ source "https://rubygems.org"
2
+
3
+ ruby "<%= Kratos::RUBY_VERSION %>"
4
+
5
+ gem "email_validator"
6
+ gem "i18n-tasks"
7
+ gem "autoprefixer-rails"
8
+ gem "bourbon", "~> 4.2.0"
9
+ gem "flutie"
10
+ gem "jquery-rails"
11
+ gem "normalize-rails", "~> 3.0.0"
12
+ gem "pg"
13
+ gem "puma"
14
+ gem "rails", "<%= Kratos::RAILS_VERSION %>"
15
+ gem "recipient_interceptor"
16
+ gem "sass-rails", "~> 5.0"
17
+ gem "title"
18
+ gem "uglifier"
19
+ gem "jbuilder"
20
+ gem "yajl-ruby", require: "yajl"
21
+ gem "sidekiq"
22
+ gem "sinatra", require: nil
23
+ gem "redis-rails"
24
+ gem "dalli"
25
+ gem "lograge"
26
+ gem "whenever", require: false
27
+ gem "premailer-rails"
28
+ gem "nokogiri", ">= 1.6.7.2"
29
+ gem "geocoder"
30
+ gem "aws-sdk"
31
+ gem "figaro"
32
+ gem "httparty"
33
+
34
+ group :development do
35
+ gem "quiet_assets"
36
+ gem "letter_opener"
37
+ gem "capistrano", "~> 3.1"
38
+ gem "capistrano-rails", "~> 1.1"
39
+ gem "capistrano-rbenv", "~> 2.0"
40
+ end
41
+
42
+ group :development, :test do
43
+ gem "pry-meta"
44
+ gem "bullet"
45
+ gem "bundler-audit", require: false
46
+ gem "factory_girl_rails"
47
+ gem "ffaker"
48
+ gem "rspec-rails", "~> 3.4.0"
49
+ gem 'rubocop', require: false
50
+ gem 'brakeman', require: false
51
+ end
52
+
53
+ group :test do
54
+ gem "capybara"
55
+ gem "database_cleaner"
56
+ gem "formulaic"
57
+ gem "launchy"
58
+ gem "shoulda-matchers"
59
+ gem "simplecov", require: false
60
+ gem "timecop"
61
+ gem "webmock"
62
+ gem "rspec_api_documentation"
63
+ end
64
+
65
+ group :staging, :production do
66
+ gem "rails_stdout_logging"
67
+ end
@@ -0,0 +1,2 @@
1
+ web: bundle exec puma -p $PORT -C ./config/puma.rb
2
+ worker: bundle exec sidekiq
@@ -0,0 +1,29 @@
1
+ # <%= app_name.humanize %>
2
+
3
+ ## Getting Started
4
+
5
+ After you have cloned this repo, run this setup script to set up your machine
6
+ with the necessary dependencies to run and test this app:
7
+
8
+ % ./bin/setup
9
+
10
+ It assumes you have a machine equipped with Ruby, Postgres, etc.
11
+
12
+ ## Deploy
13
+
14
+ Provision your server using ansible. You must have a figaro settings file at
15
+ `~/.<app-name>.yml`. The foreman rake task will copy this file to the root
16
+ directory of your application. After provisioning, run:
17
+
18
+ % cap production deploy
19
+ % cap production deploy:restart
20
+
21
+ If you have multiple servers configured in production, the restart will be with
22
+ one server at a time, avoiding offline time.
23
+
24
+ ## Puma configuration
25
+
26
+ The figaro settings is not loaded before puma, so you must setup puma variables
27
+ using the `.env` file. These environment variables are: `WEB_CONCURRENCY` and
28
+ `MAX_THREADS`.
29
+
@@ -0,0 +1,10 @@
1
+ <%= javascript_include_tag :application %>
2
+
3
+ <%= yield :javascript %>
4
+
5
+ <% if Rails.env.test? %>
6
+ <%= javascript_tag do %>
7
+ $.fx.off = true;
8
+ $.ajaxSetup({ async: false });
9
+ <% end %>
10
+ <% end %>
@@ -0,0 +1,18 @@
1
+ module AcceptanceHelpers
2
+ def json
3
+ @json ||= if respond_to?(:response_body)
4
+ JSON.parse(response_body, symbolize_names: true)
5
+ else
6
+ JSON.parse(response.body, symbolize_names: true)
7
+ end
8
+ end
9
+
10
+ def sign_in_as(app)
11
+ token = create(:auth_token, authenticable: app)
12
+ header 'Authorization', "Token token=#{token.token}"
13
+ end
14
+ end
15
+
16
+ RSpec.configure do |config|
17
+ config.include Acceptance::JsonHelpers, type: :acceptance
18
+ end
@@ -0,0 +1,5 @@
1
+ RSpec.configure do |config|
2
+ config.before(:each) do
3
+ ActionMailer::Base.deliveries.clear
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ @charset "utf-8";
2
+
3
+ @import "normalize-rails";
4
+ @import "bourbon";
@@ -0,0 +1,25 @@
1
+ #!/bin/sh
2
+
3
+ # Set up Rails app. Run this script immediately after cloning the codebase.
4
+ # https://github.com/thoughtbot/guides/tree/master/protocol
5
+
6
+ # Exit if any subcommand fails
7
+ set -e
8
+
9
+ # Set up Ruby dependencies via Bundler
10
+ gem install bundler --conservative
11
+ bundle check || bundle install
12
+
13
+ if [ ! -f config/application.yml ]; then
14
+ cp .sample.application.yml config/application.yml
15
+ fi
16
+
17
+ # Set up database and add any development seed data
18
+ bin/rake dev:prime
19
+
20
+ # Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
21
+ mkdir -p .git/safe
22
+
23
+ # Only if this isn't CI
24
+ # if [ -z "$CI" ]; then
25
+ # fi
@@ -0,0 +1,9 @@
1
+ namespace :brakeman do
2
+ desc 'Run Brakeman'
3
+ task :run, :output_files do |_, args|
4
+ require 'brakeman'
5
+
6
+ files = args[:output_files].split(' ') if args[:output_files]
7
+ Brakeman.run app_path: '.', output_files: files, print_report: true
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ if Rails.env.development? || Rails.env.test?
2
+ require 'bundler/audit/cli'
3
+
4
+ namespace :bundler do
5
+ desc 'Updates the ruby-advisory-db and runs audit'
6
+ task :audit do
7
+ %w(update check).each do |command|
8
+ Bundler::Audit::CLI.start [command]
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1 @@
1
+ server 'example.org', user: 'deploy', roles: %w(app db web)
@@ -0,0 +1,17 @@
1
+ require 'capybara/poltergeist'
2
+ require 'capybara/rails'
3
+ require 'capybara/rspec'
4
+
5
+ Capybara.register_driver :poltergeist do |app|
6
+ Capybara::Poltergeist::Driver.new(
7
+ app,
8
+ timeout: 30,
9
+ phantomjs_options: ['--load-images=no', '--ignore-ssl-errors=yes',
10
+ '--disk-cache=yes'],
11
+ debug: false
12
+ )
13
+ end
14
+
15
+ Capybara.javascript_driver = :poltergeist
16
+ Capybara.default_wait_time = 15
17
+ Capybara.automatic_reload = true
@@ -0,0 +1,9 @@
1
+ machine:
2
+ environment:
3
+ COVERAGE: true
4
+ database:
5
+ override:
6
+ - bin/setup
7
+ test:
8
+ override:
9
+ - bin/rake
@@ -0,0 +1,107 @@
1
+ en:
2
+ date:
3
+ abbr_day_names:
4
+ - Sun
5
+ - Mon
6
+ - Tue
7
+ - Wed
8
+ - Thu
9
+ - Fri
10
+ - Sat
11
+ abbr_month_names:
12
+ -
13
+ - Jan
14
+ - Feb
15
+ - Mar
16
+ - Apr
17
+ - May
18
+ - Jun
19
+ - Jul
20
+ - Aug
21
+ - Sep
22
+ - Oct
23
+ - Nov
24
+ - Dec
25
+ day_names:
26
+ - Sunday
27
+ - Monday
28
+ - Tuesday
29
+ - Wednesday
30
+ - Thursday
31
+ - Friday
32
+ - Saturday
33
+ formats:
34
+ default: "%Y-%m-%d"
35
+ long: "%B %d, %Y"
36
+ short: "%b %d"
37
+ month_names:
38
+ -
39
+ - January
40
+ - February
41
+ - March
42
+ - April
43
+ - May
44
+ - June
45
+ - July
46
+ - August
47
+ - September
48
+ - October
49
+ - November
50
+ - December
51
+ order:
52
+ - :year
53
+ - :month
54
+ - :day
55
+ datetime:
56
+ distance_in_words:
57
+ about_x_hours:
58
+ one: about 1 hour
59
+ other: about %{count} hours
60
+ about_x_months:
61
+ one: about 1 month
62
+ other: about %{count} months
63
+ about_x_years:
64
+ one: about 1 year
65
+ other: about %{count} years
66
+ almost_x_years:
67
+ one: almost 1 year
68
+ other: almost %{count} years
69
+ half_a_minute: half a minute
70
+ less_than_x_minutes:
71
+ one: less than a minute
72
+ other: less than %{count} minutes
73
+ less_than_x_seconds:
74
+ one: less than 1 second
75
+ other: less than %{count} seconds
76
+ over_x_years:
77
+ one: over 1 year
78
+ other: over %{count} years
79
+ x_days:
80
+ one: 1 day
81
+ other: "%{count} days"
82
+ x_minutes:
83
+ one: 1 minute
84
+ other: "%{count} minutes"
85
+ x_months:
86
+ one: 1 month
87
+ other: "%{count} months"
88
+ x_seconds:
89
+ one: 1 second
90
+ other: "%{count} seconds"
91
+ prompts:
92
+ day: Day
93
+ hour: Hour
94
+ minute: Minute
95
+ month: Month
96
+ second: Seconds
97
+ year: Year
98
+ time:
99
+ am: am
100
+ formats:
101
+ default: "%a, %d %b %Y %H:%M:%S %z"
102
+ long: "%B %d, %Y %H:%M"
103
+ short: "%d %b %H:%M"
104
+ time: "%H:%M"
105
+ medium: "%Y-%m-%d %H:%M"
106
+ datetime: '%Y-%m-%d %H:%M:%S'
107
+ pm: pm
@@ -0,0 +1,3 @@
1
+ en:
2
+ titles:
3
+ application: <%= app_name.humanize %>
@@ -0,0 +1,108 @@
1
+ ---
2
+ pt-BR:
3
+ date:
4
+ abbr_day_names:
5
+ - Dom
6
+ - Seg
7
+ - Ter
8
+ - Qua
9
+ - Qui
10
+ - Sex
11
+ - Sáb
12
+ abbr_month_names:
13
+ -
14
+ - Jan
15
+ - Fev
16
+ - Mar
17
+ - Abr
18
+ - Mai
19
+ - Jun
20
+ - Jul
21
+ - Ago
22
+ - Set
23
+ - Out
24
+ - Nov
25
+ - Dez
26
+ day_names:
27
+ - Domingo
28
+ - Segunda
29
+ - Terça
30
+ - Quarta
31
+ - Quinta
32
+ - Sexta
33
+ - Sábado
34
+ formats:
35
+ default: "%d/%m/%Y"
36
+ long: "%d de %B de %Y"
37
+ short: "%d de %B"
38
+ month_names:
39
+ -
40
+ - Janeiro
41
+ - Fevereiro
42
+ - Março
43
+ - Abril
44
+ - Maio
45
+ - Junho
46
+ - Julho
47
+ - Agosto
48
+ - Setembro
49
+ - Outubro
50
+ - Novembro
51
+ - Dezembro
52
+ order:
53
+ - :day
54
+ - :month
55
+ - :year
56
+ datetime:
57
+ distance_in_words:
58
+ about_x_hours:
59
+ one: aproximadamente 1 hora
60
+ other: aproximadamente %{count} horas
61
+ about_x_months:
62
+ one: aproximadamente 1 mês
63
+ other: aproximadamente %{count} meses
64
+ about_x_years:
65
+ one: aproximadamente 1 ano
66
+ other: aproximadamente %{count} anos
67
+ almost_x_years:
68
+ one: quase 1 ano
69
+ other: quase %{count} anos
70
+ half_a_minute: meio minuto
71
+ less_than_x_minutes:
72
+ one: menos de um minuto
73
+ other: menos de %{count} minutos
74
+ less_than_x_seconds:
75
+ one: menos de 1 segundo
76
+ other: menos de %{count} segundos
77
+ over_x_years:
78
+ one: mais de 1 ano
79
+ other: mais de %{count} anos
80
+ x_days:
81
+ one: 1 dia
82
+ other: "%{count} dias"
83
+ x_minutes:
84
+ one: 1 minuto
85
+ other: "%{count} minutos"
86
+ x_months:
87
+ one: 1 mês
88
+ other: "%{count} meses"
89
+ x_seconds:
90
+ one: 1 segundo
91
+ other: "%{count} segundos"
92
+ prompts:
93
+ day: Dia
94
+ hour: Hora
95
+ minute: Minuto
96
+ month: Mês
97
+ second: Segundo
98
+ year: Ano
99
+ time:
100
+ am: ''
101
+ pm: ''
102
+ formats:
103
+ default: "%a, %d %b %Y %H:%M:%S"
104
+ long: "%d de %B de %Y, %H:%M"
105
+ short: "%d de %B, %H:%M"
106
+ medium: "%d/%m/%Y %H:%M"
107
+ datetime: "%d/%m/%Y %H:%M:%S"
108
+ time: "%H:%M"
@@ -0,0 +1,4 @@
1
+ ---
2
+ pt-BR:
3
+ titles:
4
+ application: <%= app_name.humanize %>
@@ -0,0 +1,21 @@
1
+ RSpec.configure do |config|
2
+ config.before(:suite) do
3
+ DatabaseCleaner.clean_with(:deletion)
4
+ end
5
+
6
+ config.before(:each) do
7
+ DatabaseCleaner.strategy = :transaction
8
+ end
9
+
10
+ config.before(:each, js: true) do
11
+ DatabaseCleaner.strategy = :deletion
12
+ end
13
+
14
+ config.before(:each) do
15
+ DatabaseCleaner.start
16
+ end
17
+
18
+ config.after(:each) do
19
+ DatabaseCleaner.clean
20
+ end
21
+ end