cybele 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +27 -0
  4. data/cybele.gemspec +0 -1
  5. data/lib/cybele/generators/app_generator.rb +4 -5
  6. data/lib/cybele/helpers/active_storage.rb +8 -22
  7. data/lib/cybele/helpers/devise.rb +5 -0
  8. data/lib/cybele/helpers/general.rb +0 -6
  9. data/lib/cybele/helpers/pronto.rb +1 -1
  10. data/lib/cybele/version.rb +2 -2
  11. data/spec/features/cli_help_spec.rb +5 -0
  12. data/spec/features/new_default_project_spec.rb +30 -175
  13. data/spec/features/new_not_default_no_skip_docker_project_spec.rb +18 -0
  14. data/spec/features/new_not_default_no_skip_sidekiq_project_spec.rb +18 -0
  15. data/spec/features/new_not_default_project_spec.rb +30 -118
  16. data/spec/files/README_DEFAULT.md +39 -0
  17. data/spec/files/README_ONLY_NO_SKIP_DOCKER.md +36 -0
  18. data/spec/files/README_ONLY_NO_SKIP_SIDEKIQ.md +26 -0
  19. data/spec/files/README_SKIP_ALL.md +23 -0
  20. data/spec/spec_helper.rb +0 -9
  21. data/spec/support/cybele_test_helpers.rb +10 -2
  22. data/spec/support/shared_examples/better_errors_test_helper.rb +11 -0
  23. data/spec/support/shared_examples/bullet_test_helper.rb +13 -0
  24. data/spec/support/shared_examples/colorize_test_helper.rb +10 -0
  25. data/spec/support/shared_examples/config_test_helper.rb +36 -0
  26. data/spec/support/shared_examples/cybele_test_helper.rb +10 -0
  27. data/spec/support/shared_examples/default_view_test_helper.rb +11 -0
  28. data/spec/support/shared_examples/devise_test_helper.rb +45 -0
  29. data/spec/support/shared_examples/docker_development_environment.rb +74 -0
  30. data/spec/support/shared_examples/dotenv_test_helper.rb +31 -0
  31. data/spec/support/shared_examples/error_pages_test_helper.rb +24 -0
  32. data/spec/support/shared_examples/force_ssl_test_helper.rb +24 -0
  33. data/spec/support/shared_examples/git_ignore_test_helper.rb +12 -0
  34. data/spec/support/shared_examples/locale_language_test_helper.rb +43 -0
  35. data/spec/support/shared_examples/mailer_test_helper.rb +13 -0
  36. data/spec/support/shared_examples/model_test_helper.rb +13 -0
  37. data/spec/support/shared_examples/pronto_test_helper.rb +41 -0
  38. data/spec/support/shared_examples/rails_i18n_test_helper.rb +10 -0
  39. data/spec/support/shared_examples/ransack_test_helper.rb +10 -0
  40. data/spec/support/shared_examples/recipient_interceptor_test_helper.rb +13 -0
  41. data/spec/support/shared_examples/responder_test_helper.rb +32 -0
  42. data/spec/support/shared_examples/rollbar_test_helper.rb +13 -0
  43. data/spec/support/shared_examples/roo_test_helper.rb +10 -0
  44. data/spec/support/shared_examples/roo_xls_test_helper.rb +10 -0
  45. data/spec/support/shared_examples/sidekiq_environment.rb +29 -0
  46. data/spec/support/shared_examples/to_xls_test_helper.rb +10 -0
  47. data/spec/support/shared_examples/will_paginate_test_helper.rb +11 -0
  48. data/spec/support/shared_examples/write_xlsx_test_helper.rb +10 -0
  49. data/templates/Gemfile.erb +11 -12
  50. data/templates/README.md.erb +14 -2
  51. data/templates/active_storage/active_storage.yml.erb +8 -0
  52. data/templates/active_storage/amazon_env_all.erb +1 -3
  53. data/templates/app_files/app/views/hq/admins/_form.html.haml +2 -2
  54. data/templates/app_files/app/views/hq/admins/edit.html.haml +1 -1
  55. data/templates/app_files/app/views/hq/users/_form.html.haml +2 -2
  56. data/templates/app_files/app/views/hq/users/edit.html.haml +1 -1
  57. data/templates/app_files/app/views/user/profile/_form.html.haml +1 -1
  58. data/templates/bullet/bullet_settings.rb.erb +1 -1
  59. data/templates/cybele_gitignore +1 -1
  60. data/templates/docker/Dockerfile.erb +1 -1
  61. data/templates/docker/docker_env_local_sample.erb +2 -5
  62. data/templates/docker/docker_env_local_sample_host.erb +1 -1
  63. data/templates/docker/docker_env_local_sample_sidekiq.erb +1 -1
  64. data/templates/docker/docker_env_staging_production_sidekiq.erb +1 -1
  65. data/templates/dotenv/.env.local.erb +2 -0
  66. data/templates/dotenv/.env.production.erb +2 -0
  67. data/templates/dotenv/.env.staging.erb +2 -0
  68. data/templates/mailer/.env.local.erb +1 -2
  69. data/templates/pronto/.erb-lint.yml.erb +9 -0
  70. data/templates/ruby-version +1 -1
  71. data/templates/sidekiq/sidekiq.rb.erb +1 -1
  72. metadata +75 -41
  73. data/spec/support/config_test_helper.rb +0 -36
  74. data/spec/support/devise_test_helper.rb +0 -45
  75. data/spec/support/dotenv_test_helper.rb +0 -31
  76. data/spec/support/error_pages_test_helper.rb +0 -24
  77. data/spec/support/force_ssl_test_helper.rb +0 -24
  78. data/spec/support/git_ignore_test_helper.rb +0 -10
  79. data/spec/support/locale_language_test_helper.rb +0 -43
  80. data/spec/support/pronto_test_helpers.rb +0 -41
  81. data/spec/support/responder_test_helper.rb +0 -32
  82. data/templates/guardfile/guardfile_settings.rb.erb +0 -49
  83. data/templates/pronto/config.reek.erb +0 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 265c511e24b5aa4e0e12b5e2c2c3d262564f70293052c4705f2817976b5f73f3
4
- data.tar.gz: c02bb3c18aee4fc5f202add2c74e6a6f77f9e40c66f979c4d8ea31526701fbb7
3
+ metadata.gz: f726b1cb6912328b92da71be0e88f7bfd204f208bbe520d2fcdcdb54ff8a46b7
4
+ data.tar.gz: 75b6bc1732f293fbe7b03fb8a98af2f089bf2ce1a46d46cd017211c2e8a76b6c
5
5
  SHA512:
6
- metadata.gz: a0ca4fba87a8933618aec2d0bce1c90f3e690ff131e175e3572a1943bb4dd632231e36eebcbc9a6ef377dfe87dc01acf17e07a328b263973cd0bd439a2f24225
7
- data.tar.gz: 25e9d9cac664756a1925c8eb523b32e237babf5c0b51012bf1702c19ad9669383b788fa8ba9f2992e3e359a02fe111b45f1e5cb51b0c29cb1ae65110b703f2dd
6
+ metadata.gz: e1952a826bf490f40c326f54c9c07657b5a0cf974a91b52a2a8f3e9c141af30cb2313c9fd68e891362f3b9cc3ea8ff4062031a872e8cbb2f74d27d203186d77d
7
+ data.tar.gz: c902a27a5e6fc011caf907cb2e912b9089913afe98dc0a2b83307c37e3c68d85b8760686d5bbfe052167902618d8a174d9934de7372332fe0b9934b8be2d1562
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.5.3
@@ -1,5 +1,32 @@
1
1
 
2
2
  #### [Current]
3
+ * [864753a](../../commit/864753a) - __(İsmail Akbudak)__ Merged in feature/improve_gems (pull request [#42](../../issues/42))
4
+
5
+ Feature/improve gems
6
+
7
+ * [cd2480f](../../commit/cd2480f) - __(İsmail Akbudak)__ Change SIDEKIQ_REDIS_URL with REDIS_URL
8
+ * [0cf91a1](../../commit/0cf91a1) - __(İsmail Akbudak)__ Fix alignment problem for rspec test
9
+ * [914975a](../../commit/914975a) - __(İsmail Akbudak)__ Update template gemfile gems versions
10
+ * [b5e504c](../../commit/b5e504c) - __(İsmail Akbudak)__ Code refactor for test specs
11
+ * [e690b25](../../commit/e690b25) - __(İsmail Akbudak)__ Code refactor for test specs and change sidekiq_redis environment key
12
+ * [6b10ade](../../commit/6b10ade) - __(İsmail Akbudak)__ Update rails version
13
+ * [3fa1533](../../commit/3fa1533) - __(İsmail Akbudak)__ Remove pronto-reek gem from cybele gemspec
14
+ * [3ee5639](../../commit/3ee5639) - __(İsmail Akbudak)__ Remove guard gem configs
15
+ * [85eadfe](../../commit/85eadfe) - __(İsmail Akbudak)__ Fix ap view files wrong titles
16
+ * [4036acb](../../commit/4036acb) - __(İsmail Akbudak)__ Add rails credentials edit information to readme
17
+ * [f246d62](../../commit/f246d62) - __(İsmail Akbudak)__ Update ransack gem version and add binding_of_caller gem for development
18
+ * [5123d07](../../commit/5123d07) - __(İsmail Akbudak)__ Fix devise generate model migration commented lines
19
+ * [1d3f4b6](../../commit/1d3f4b6) - __(İsmail Akbudak)__ Upgrade ruby version to 2.5.3
20
+ * [995ded4](../../commit/995ded4) - __(İsmail Akbudak)__ Improve environment file contents
21
+ * [b426d4e](../../commit/b426d4e) - __(İsmail Akbudak)__ Add master_key to environment files
22
+ * [df9542e](../../commit/df9542e) - __(İsmail Akbudak)__ Fix active_storage initialization
23
+ * [cbc7830](../../commit/cbc7830) - __(İsmail Akbudak)__ Add erb_lint pronto runner
24
+ * [809ec01](../../commit/809ec01) - __(İsmail Akbudak)__ Merge tag 'v2.1.0' into develop
25
+
26
+ v2.1.0
27
+
28
+ #### v2.1.0
29
+ * [f7d00fc](../../commit/f7d00fc) - __(İsmail Akbudak)__ Update CHANGELOG file
3
30
  * [52832d1](../../commit/52832d1) - __(İsmail Akbudak)__ Fix pronto warnings
4
31
  * [148c6d4](../../commit/148c6d4) - __(İsmail Akbudak)__ Update CHANGELOG file
5
32
  * [ee9d462](../../commit/ee9d462) - __(İsmail AKBUDAK)__ Merge pull request [#127](../../issues/127) from lab2023/feature/update_ruby_rails_to_latest_version
@@ -28,7 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency 'pronto', '~> 0.9.5'
29
29
  spec.add_development_dependency 'pronto-fasterer', '~> 0.9.0'
30
30
  spec.add_development_dependency 'pronto-flay', '~> 0.9.0'
31
- spec.add_development_dependency 'pronto-reek', '~> 0.9.0'
32
31
  spec.add_development_dependency 'pronto-rubocop', '~> 0.9.0'
33
32
  spec.add_development_dependency 'rspec', '~> 3.5'
34
33
  spec.add_development_dependency 'thor', '~> 0.19.4'
@@ -156,11 +156,6 @@ module Cybele
156
156
  build :generate_rollbar
157
157
  end
158
158
 
159
- def setup_guard
160
- say 'Generate guard', :green
161
- build :generate_guard
162
- end
163
-
164
159
  def configure_locale_language
165
160
  say 'Configure locale', :green
166
161
  build :configure_locale_language
@@ -283,6 +278,10 @@ module Cybele
283
278
 
284
279
  private
285
280
 
281
+ def config_master_key_content
282
+ IO.read(File.join(destination_root, '/config/master.key'))
283
+ end
284
+
286
285
  # :reek:TooManyStatements
287
286
  def ask_questions(options)
288
287
  say 'Ask cybele options', :green
@@ -4,36 +4,22 @@ module Cybele
4
4
  module Helpers
5
5
  module ActiveStorage
6
6
  def active_storage_setting
7
- %w[config/environments/production.rb config/environments/staging.rb
8
- config/environments/development.rb].each do |file|
7
+ %w[
8
+ config/environments/production.rb
9
+ config/environments/staging.rb
10
+ ].each do |file|
9
11
  gsub_file file,
10
12
  /config.active_storage.service = :local/,
11
13
  'config.active_storage.service = :amazon'
12
14
  end
13
- handle_active_storage_change_file_content
15
+
14
16
  %w[.env.local .env.production .env.staging .env.sample].each do |env|
15
17
  append_file(env, template_content('active_storage/amazon_env_all.erb'))
16
18
  end
17
- end
18
-
19
- private
20
19
 
21
- def handle_active_storage_change_file_content
22
- replace_in_file 'config/storage.yml',
23
- 'Rails.application.credentials.dig(:aws, :access_key_id)',
24
- "ENV['AWS_ACCESS_KEY_ID']"
25
- replace_in_file 'config/storage.yml',
26
- 'Rails.application.credentials.dig(:aws, :secret_access_key)',
27
- "ENV['AWS_SECRET_ACCESS_KEY']"
28
- replace_in_file 'config/storage.yml',
29
- 'us-east-1',
30
- "<%= ENV['AWS_REGION'] %>"
31
- replace_in_file 'config/storage.yml',
32
- 'your_own_bucket',
33
- "<%= ENV['BUCKET_NAME'] %>"
34
- replace_in_file 'config/storage.yml',
35
- '# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)',
36
- '# AWS S3 access variable'
20
+ inject_into_file 'config/storage.yml',
21
+ template_content('active_storage/active_storage.yml.erb'),
22
+ before: '# Use rails credentials:edit to set the AWS secrets'
37
23
  end
38
24
  end
39
25
  end
@@ -66,6 +66,11 @@ module Cybele
66
66
  def add_default_value_to_migrations
67
67
  Dir.glob('db/migrate/*devise_create*.rb') do |file|
68
68
  replace_in_file file, 't.boolean :is_active', 't.boolean :is_active, default: true'
69
+ uncomment_lines file, /t.integer :sign_in_count, default: 0, null: false/
70
+ uncomment_lines file, /t.datetime :current_sign_in_at/
71
+ uncomment_lines file, /t.datetime :last_sign_in_at/
72
+ uncomment_lines file, /t.inet :current_sign_in_ip/
73
+ uncomment_lines file, /t.inet :last_sign_in_ip/
69
74
  end
70
75
  end
71
76
  end
@@ -59,12 +59,6 @@ module Cybele
59
59
  generate 'rollbar'
60
60
  end
61
61
 
62
- def generate_guard
63
- bundle_command 'exec guard init'
64
- inject_into_file('Guardfile', "\n\n#{template_content('guardfile/guardfile_settings.rb.erb')}",
65
- after: 'config/Guardfile" instead of "Guardfile"')
66
- end
67
-
68
62
  def configure_bullet
69
63
  configure_environment 'development', template_content('bullet/bullet_settings.rb.erb')
70
64
  end
@@ -24,7 +24,7 @@ module Cybele
24
24
  files_to_template(
25
25
  'pronto/example.pronto.yml.erb' => 'example.pronto.yml',
26
26
  'pronto/.haml-lint.yml.erb' => '.haml-lint.yml',
27
- 'pronto/config.reek.erb' => 'config.reek',
27
+ 'pronto/.erb-lint.yml.erb' => '.erb-lint.yml',
28
28
  'pronto/.rubocop.yml.erb' => '.rubocop.yml',
29
29
  'pronto/.flayignore.erb' => '.flayignore'
30
30
  )
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cybele
4
- RAILS_VERSION = ['~> 5.2.0', '>= 5.2.0'].freeze
4
+ RAILS_VERSION = ['~> 5.2.2', '>= 5.2.2'].freeze
5
5
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
6
- VERSION = '2.1.0'
6
+ VERSION = '2.2.0'
7
7
  end
@@ -29,6 +29,11 @@ Cybele options:
29
29
  # Default: true
30
30
  [--skip-create-database], [--no-skip-create-database] # Skip create database. Default: don't skip
31
31
  [--skip-sidekiq], [--no-skip-sidekiq] # Skip sidekiq integration. Default: don't skip
32
+ [--skip-simple-form], [--no-skip-simple-form] # Skip simple_form integration. Default: don't skip
33
+ [--skip-show-for], [--no-skip-show-for] # Skip show_for integration. Default: don't skip
34
+ [--skip-haml], [--no-skip-haml] # Skip haml and haml-rails integration. Default: don't skip
35
+ [--skip-view-files], [--no-skip-view-files] # Skip view files. Default: don't skip. Dependent: haml, show-for, simple-form
36
+ [--skip-docker], [--no-skip-docker] # Skip docker development environment. Default: don't skip
32
37
  EOH
33
38
  end
34
39
 
@@ -24,94 +24,31 @@ RSpec.describe 'Create new project with default configuration' do
24
24
  expect(database_file).to match(/^ database: #{app_name}_staging/)
25
25
  end
26
26
 
27
- it 'uses sidekiq' do
28
- gemfile_file = content('Gemfile')
29
- expect(gemfile_file).to match(/^gem 'sidekiq'/)
30
- expect(gemfile_file).to match(/^gem 'sidekiq-cron'/)
31
- expect(gemfile_file).to match(/^gem 'cocaine'/)
32
- expect(gemfile_file).to match(/^gem 'devise-async'/)
33
-
34
- sidekiq_file = content('config/sidekiq.yml')
35
- expect(sidekiq_file).to match('[high_priority, 2]')
36
-
37
- sidekiq_schedule_file = content('config/sidekiq_schedule.yml')
38
- expect(sidekiq_schedule_file).to match(/-> Daily at midnight/)
27
+ it_behaves_like 'uses sidekiq'
39
28
 
40
- initializers_file = content('config/initializers/sidekiq.rb')
41
- expect(initializers_file).to match("^require 'sidekiq'")
42
- expect(initializers_file).to match("^require 'sidekiq/web'")
29
+ it_behaves_like 'uses responders'
43
30
 
44
- routes_file = content('config/routes.rb')
45
- expect(routes_file).to match("^require 'sidekiq/web'")
46
- expect(routes_file).to match("^require 'sidekiq/cron/web'")
47
- expect(routes_file).to match(/# ========== Sidekiq ==========/)
48
-
49
- rake_file = content('lib/tasks/sidekiq.rake')
50
- expect(rake_file).to match(/^namespace :sidekiq/)
51
- end
31
+ it_behaves_like 'uses cybele_version'
52
32
 
53
- it 'uses responders' do
54
- responder_test
55
- end
33
+ it_behaves_like 'uses rollbar'
56
34
 
57
- it 'uses cybele_version' do
58
- expect(File).to exist(file_project_path('VERSION.txt'))
59
- expect(File).to exist(file_project_path('public/VERSION.txt'))
60
- end
35
+ it_behaves_like 'uses ransack'
61
36
 
62
- it 'uses rollbar' do
63
- gemfile_file = content('Gemfile')
64
- expect(gemfile_file).to match(/^gem 'rollbar'/)
37
+ it_behaves_like 'uses will_paginate'
65
38
 
66
- config_file = content('config/initializers/rollbar.rb')
67
- expect(config_file).to match(/^Rollbar.configure/)
68
- end
39
+ it_behaves_like 'uses to_xls'
69
40
 
70
- it 'uses ransack' do
71
- gemfile_file = content('Gemfile')
72
- expect(gemfile_file).to match(/^gem 'ransack'/)
73
- end
74
-
75
- it 'uses will_paginate' do
76
- gemfile_file = content('Gemfile')
77
- expect(gemfile_file).to match(/^gem 'will_paginate'/)
78
- expect(gemfile_file).to match(/^gem 'will_paginate-bootstrap'/)
79
- end
80
-
81
- it 'uses to_xls' do
82
- gemfile_file = content('Gemfile')
83
- expect(gemfile_file).to match(/^gem 'to_xls'/)
84
- end
85
-
86
- it 'uses roo' do
87
- gemfile_file = content('Gemfile')
88
- expect(gemfile_file).to match(/^gem 'roo'/)
89
- end
41
+ it_behaves_like 'uses roo'
90
42
 
91
- it 'uses roo-xls' do
92
- gemfile_file = content('Gemfile')
93
- expect(gemfile_file).to match(/^gem 'roo-xls'/)
94
- end
43
+ it_behaves_like 'uses roo-xls'
95
44
 
96
- it 'uses write_xlsx' do
97
- gemfile_file = content('Gemfile')
98
- expect(gemfile_file).to match(/^gem 'write_xlsx'/)
99
- end
45
+ it_behaves_like 'uses write_xlsx'
100
46
 
101
- it 'uses colorize' do
102
- gemfile_file = content('Gemfile')
103
- expect(gemfile_file).to match("gem 'colorize'")
104
- end
47
+ it_behaves_like 'uses colorize'
105
48
 
106
- it 'uses better_errors' do
107
- gemfile_file = content('Gemfile')
108
- expect(gemfile_file).to match("gem 'better_errors'")
109
- end
49
+ it_behaves_like 'uses better_errors'
110
50
 
111
- it 'uses rails-i18n' do
112
- gemfile_file = content('Gemfile')
113
- expect(gemfile_file).to match(/^gem 'rails-i18n'/)
114
- end
51
+ it_behaves_like 'uses rails-i18n'
115
52
 
116
53
  it 'uses show_for' do
117
54
  gemfile_file = content('Gemfile')
@@ -127,21 +64,11 @@ RSpec.describe 'Create new project with default configuration' do
127
64
  expect(show_for_tr_yml_file).to match('show_for')
128
65
  end
129
66
 
130
- it 'uses config and staging file' do
131
- config_test
132
- end
67
+ it_behaves_like 'uses config'
133
68
 
134
- it 'uses recipient_interceptor' do
135
- gemfile_file = content('Gemfile')
136
- expect(gemfile_file).to match(/^gem 'recipient_interceptor'/)
69
+ it_behaves_like 'uses recipient_interceptor'
137
70
 
138
- config_staging_file = content('config/environments/staging.rb')
139
- expect(config_staging_file).to match('RecipientInterceptor.new')
140
- end
141
-
142
- it 'uses locale_language' do
143
- locale_language_test
144
- end
71
+ it_behaves_like 'uses locale_language'
145
72
 
146
73
  it 'uses simple_form' do
147
74
  gemfile_file = content('Gemfile')
@@ -160,14 +87,9 @@ RSpec.describe 'Create new project with default configuration' do
160
87
  expect(simple_form_tr_yml_file).to match('simple_form')
161
88
  end
162
89
 
163
- it 'control .env files' do
164
- dotenv_test
165
- end
90
+ it_behaves_like 'has .env files'
166
91
 
167
92
  it 'uses mailer' do
168
- gemfile_file = content('Gemfile')
169
- expect(gemfile_file).to match("gem 'mailtrap'")
170
-
171
93
  expect(File).to exist(file_project_path('config/settings/production.yml'))
172
94
  expect(File).to exist(file_project_path('config/settings/staging.yml'))
173
95
 
@@ -186,25 +108,13 @@ RSpec.describe 'Create new project with default configuration' do
186
108
  expect(File).to exist(file_project_path('app/views/layouts/application.html.haml'))
187
109
  end
188
110
 
189
- it 'uses bullet' do
190
- gemfile_file = content('Gemfile')
191
- expect(gemfile_file).to match("gem 'bullet'")
111
+ it_behaves_like 'uses bullet'
192
112
 
193
- locale_file = content('config/environments/development.rb')
194
- expect(locale_file).to match('Bullet')
195
- end
113
+ it_behaves_like 'uses devise'
196
114
 
197
- it 'uses devise' do
198
- devise_test
199
- end
200
-
201
- it 'uses error_pages' do
202
- error_pages_test
203
- end
115
+ it_behaves_like 'uses error_pages'
204
116
 
205
- it 'uses gitignore' do
206
- git_ignore_test
207
- end
117
+ it_behaves_like 'uses gitignore'
208
118
 
209
119
  it 'uses asset files' do
210
120
  gemfile_file = content('Gemfile')
@@ -377,80 +287,25 @@ RSpec.describe 'Create new project with default configuration' do
377
287
  end
378
288
  end
379
289
 
380
- it 'uses default view files' do
381
- # Mailer files
382
- hq_admins_view = content('app/views/admin_mailer/login_info.html.haml')
383
- expect(hq_admins_view).to match('@admin')
384
- end
290
+ it_behaves_like 'uses default view files'
385
291
 
386
292
  it 'configure routes file' do
387
293
  route_file = content('config/routes.rb')
388
294
  expect(route_file).to match('concern :activeable')
389
295
  end
390
296
 
391
- it 'uses model files' do
392
- admin_model = content('app/models/admin.rb')
393
- expect(admin_model).to match('login_info_mailer')
297
+ it_behaves_like 'uses model files'
394
298
 
395
- audit_model = content('app/models/audit.rb')
396
- expect(audit_model).to match('class Audit')
397
- end
299
+ it_behaves_like 'uses mailer files'
398
300
 
399
- it 'uses mailer files' do
400
- admin_mailer = content('app/mailers/admin_mailer.rb')
401
- expect(admin_mailer).to match('class AdminMailer')
301
+ it_behaves_like 'uses ssl_setting'
402
302
 
403
- application_mailer = content('app/mailers/application_mailer.rb')
404
- expect(application_mailer).to match('Settings.email.noreply')
405
- end
303
+ it_behaves_like 'uses docker development environment'
406
304
 
407
- it 'uses ssl_setting' do
408
- force_ssl_test
409
- end
410
-
411
- it 'uses docker development environment' do
412
-
413
- file_exist_test(
414
- %w[
415
- docker-compose.yml
416
- Dockerfile
417
- bin/start-app.sh
418
- bin/start-sidekiq.sh
419
- ]
420
- )
421
-
422
- file_exist_test(
423
- %w[
424
- .env.sample
425
- .env.local
426
- .environments/.env.local
427
- ]
428
- ) do |env|
429
- file = content(env)
430
- expect(file).to match('REDISTOGO_URL=redis://redis:6379/0')
431
- expect(file).to match('RACK_ENV=development')
432
- expect(file).to match('POSTGRESQL_HOST=postgres')
433
- expect(file).to match('REDIS_HOST=redis')
434
- end
435
-
436
- file_exist_test(
437
- %w[
438
- .environments/.env.staging
439
- .environments/.env.production
440
- ]
441
- ) do |env|
442
- expect(content(env)).to match('REDISTOGO_URL=')
443
- end
444
- end
445
-
446
- it 'uses pronto' do
447
- pronto_test
448
- end
449
-
450
- it 'uses guardfile' do
451
- gemfile_file = content('Gemfile')
452
- expect(gemfile_file).to match("gem 'guard'")
305
+ it_behaves_like 'uses pronto'
453
306
 
454
- expect(File).to exist(file_project_path('Guardfile'))
307
+ it 'match readme' do
308
+ gemfile_file = content('README.md')
309
+ expect(gemfile_file).to match(file_content('README_DEFAULT.md'))
455
310
  end
456
311
  end