potassium 6.1.0 → 6.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +103 -38
  3. data/.circleci/setup-rubygems.sh +3 -0
  4. data/.gitignore +2 -1
  5. data/.node-version +1 -1
  6. data/.rubocop.yml +530 -0
  7. data/CHANGELOG.md +50 -1
  8. data/README.md +11 -3
  9. data/lib/potassium/assets/.circleci/config.yml.erb +107 -40
  10. data/lib/potassium/assets/.pryrc +0 -6
  11. data/lib/potassium/assets/.rubocop.yml +13 -0
  12. data/lib/potassium/assets/README.yml +45 -8
  13. data/lib/potassium/assets/active_admin/policies/admin_user_policy.rb +2 -0
  14. data/lib/potassium/assets/active_admin/policies/comment_policy.rb +2 -0
  15. data/lib/potassium/assets/active_admin/policies/default_policy.rb +49 -0
  16. data/lib/potassium/assets/active_admin/policies/page_policy.rb +2 -0
  17. data/lib/potassium/assets/app/javascript/app.spec.js +1 -1
  18. data/lib/potassium/assets/app/views/shared/_gtm_body.html.erb +4 -0
  19. data/lib/potassium/assets/app/views/shared/_gtm_head.html.erb +7 -0
  20. data/lib/potassium/assets/testing/.rspec +1 -0
  21. data/lib/potassium/assets/testing/devise_config.rb +6 -0
  22. data/lib/potassium/assets/testing/factory_bot_config.rb +3 -0
  23. data/lib/potassium/assets/testing/faker_config.rb +1 -0
  24. data/lib/potassium/assets/testing/power_types_config.rb +1 -0
  25. data/lib/potassium/assets/testing/rails_helper.rb +130 -49
  26. data/lib/potassium/assets/testing/shoulda_matchers_config.rb +8 -0
  27. data/lib/potassium/assets/testing/simplecov_config.rb +64 -0
  28. data/lib/potassium/assets/testing/system_tests_config.rb +6 -0
  29. data/lib/potassium/cli_options.rb +19 -3
  30. data/lib/potassium/helpers/template-helpers.rb +4 -0
  31. data/lib/potassium/recipes/admin.rb +27 -17
  32. data/lib/potassium/recipes/api.rb +2 -0
  33. data/lib/potassium/recipes/background_processor.rb +43 -32
  34. data/lib/potassium/recipes/ci.rb +9 -39
  35. data/lib/potassium/recipes/coverage.rb +35 -0
  36. data/lib/potassium/recipes/file_storage.rb +1 -1
  37. data/lib/potassium/recipes/front_end.rb +26 -13
  38. data/lib/potassium/recipes/google_tag_manager.rb +94 -0
  39. data/lib/potassium/recipes/heroku.rb +43 -31
  40. data/lib/potassium/recipes/mailer.rb +18 -5
  41. data/lib/potassium/recipes/monitoring.rb +5 -0
  42. data/lib/potassium/recipes/pundit.rb +29 -10
  43. data/lib/potassium/recipes/rails.rb +0 -4
  44. data/lib/potassium/recipes/schedule.rb +16 -1
  45. data/lib/potassium/recipes/spring.rb +9 -0
  46. data/lib/potassium/recipes/style.rb +2 -2
  47. data/lib/potassium/recipes/testing.rb +75 -18
  48. data/lib/potassium/templates/application.rb +7 -2
  49. data/lib/potassium/version.rb +7 -4
  50. data/potassium.gemspec +3 -1
  51. data/spec/features/background_processor_spec.rb +7 -5
  52. data/spec/features/ci_spec.rb +7 -4
  53. data/spec/features/coverage_spec.rb +26 -0
  54. data/spec/features/front_end_spec.rb +18 -1
  55. data/spec/features/google_tag_manager_spec.rb +36 -0
  56. data/spec/features/heroku_spec.rb +0 -4
  57. data/spec/features/mailer_spec.rb +16 -0
  58. data/spec/features/node_spec.rb +1 -1
  59. data/spec/features/pundit_spec.rb +34 -0
  60. data/spec/features/schedule_spec.rb +11 -4
  61. data/spec/features/testing_spec.rb +56 -0
  62. data/spec/support/potassium_test_helpers.rb +2 -3
  63. data/tmp/.keep +0 -0
  64. metadata +64 -15
  65. data/lib/potassium/assets/Dockerfile.ci +0 -6
  66. data/lib/potassium/assets/active_admin/admin_user_policy.rb +0 -2
  67. data/lib/potassium/assets/active_admin/comment_policy.rb +0 -2
  68. data/lib/potassium/assets/active_admin/pundit_page_policy.rb +0 -5
  69. data/lib/potassium/assets/bin/cibuild.erb +0 -117
  70. data/lib/potassium/assets/docker-compose.ci.yml +0 -12
  71. data/lib/potassium/assets/sidekiq_scheduler.yml +0 -9
@@ -4,6 +4,7 @@ RSpec.describe "Mailer" do
4
4
  let(:gemfile) { IO.read("#{project_path}/Gemfile") }
5
5
  let(:mailer_config) { IO.read("#{project_path}/config/mailer.rb") }
6
6
  let(:dev_config) { IO.read("#{project_path}/config/environments/development.rb") }
7
+ let(:sidekiq_config) { IO.read("#{project_path}/config/sidekiq.yml") }
7
8
 
8
9
  before(:all) { drop_dummy_database }
9
10
 
@@ -26,6 +27,8 @@ RSpec.describe "Mailer" do
26
27
  expect(dev_config).to include("sendgrid_dev_settings = {")
27
28
  expect(dev_config).to include("api_key: ENV['SENDGRID_API_KEY']")
28
29
  end
30
+
31
+ it { expect(sidekiq_config).to include("- mailers") }
29
32
  end
30
33
 
31
34
  context "when selecting aws_ses as mailer" do
@@ -38,5 +41,18 @@ RSpec.describe "Mailer" do
38
41
  it { expect(gemfile).to include("letter_opener") }
39
42
  it { expect(mailer_config).to include("delivery_method = :aws_sdk") }
40
43
  it { expect(dev_config).to include("delivery_method = :letter_opener") }
44
+ it { expect(sidekiq_config).to include("- mailers") }
45
+ end
46
+
47
+ context "when selecting a mailer and sidekiq" do
48
+ before :all do
49
+ drop_dummy_database
50
+ remove_project_directory
51
+ create_dummy_project(
52
+ "background_processor" => true, "email_service" => 'sendgrid'
53
+ )
54
+ end
55
+
56
+ it { expect(sidekiq_config).to include("- mailers") }
41
57
  end
42
58
  end
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe "Node" do
4
- let(:version) { "12" }
4
+ let(:version) { "14" }
5
5
 
6
6
  before(:all) do
7
7
  drop_dummy_database
@@ -0,0 +1,34 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe "Pundit" do
4
+ before :all do
5
+ drop_dummy_database
6
+ remove_project_directory
7
+ create_dummy_project("pundit" => true, "devise" => true, "admin" => true)
8
+ end
9
+
10
+ it "adds the Pundit gem to Gemfile" do
11
+ content = IO.read("#{project_path}/Gemfile")
12
+
13
+ expect(content).to include("gem 'pundit'")
14
+ end
15
+
16
+ it "setup active admin" do
17
+ content = IO.read("#{project_path}/config/initializers/active_admin.rb")
18
+
19
+ expect(content).to include("config.authorization_adapter = ActiveAdmin::PunditAdapter")
20
+ expect(content).to include("config.pundit_default_policy = 'BackOffice::DefaultPolicy'")
21
+ expect(content).to include("config.pundit_policy_namespace = :back_office")
22
+ end
23
+
24
+ it "creates default policy" do
25
+ content = IO.read("#{project_path}/app/policies/back_office/default_policy.rb")
26
+
27
+ expect(content).to include("class BackOffice::DefaultPolicy")
28
+ end
29
+
30
+ it "modifies the README file" do
31
+ readme = IO.read("#{project_path}/README.md")
32
+ expect(readme).to include("from `BackOffice::DefaultPolicy`")
33
+ end
34
+ end
@@ -1,10 +1,14 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe "schedule" do
4
+ let(:sidekiq_config) { IO.read("#{project_path}/config/sidekiq.yml") }
5
+
4
6
  before :all do
5
7
  drop_dummy_database
6
8
  remove_project_directory
7
- create_dummy_project("schedule" => true)
9
+ create_dummy_project(
10
+ "schedule" => true, "background_processor" => true, "email_service" => "sendgrid"
11
+ )
8
12
  end
9
13
 
10
14
  it "adds the sidekiq-scheduler gem to Gemfile" do
@@ -12,9 +16,12 @@ RSpec.describe "schedule" do
12
16
  expect(gemfile_content).to include("gem 'sidekiq-scheduler'")
13
17
  end
14
18
 
15
- it "creates the config with schedule" do
16
- initializer_content = IO.read("#{project_path}/config/sidekiq.yml")
17
- expect(initializer_content).to include(":schedule:")
19
+ it "adds schedule section to sidekiq config" do
20
+ expect(sidekiq_config).to include(":schedule:")
21
+ end
22
+
23
+ it "doesn't remove mailers queue" do
24
+ expect(sidekiq_config).to include("- mailers")
18
25
  end
19
26
 
20
27
  it "adds scheduler ui to the sidekiq initializer" do
@@ -0,0 +1,56 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe "Testing" do
4
+ let(:gemfile_content) { IO.read("#{project_path}/Gemfile") }
5
+ let(:rails_helper_content) { IO.read("#{project_path}/spec/rails_helper.rb") }
6
+ let(:rspec_content) { IO.read("#{project_path}/.rspec") }
7
+
8
+ let(:support_directories) do
9
+ %w{
10
+ custom_matchers
11
+ shared_examples
12
+ configurations
13
+ helpers
14
+ }
15
+ end
16
+
17
+ let(:conf_files) do
18
+ %w{
19
+ factory_bot_config.rb
20
+ power_types_config.rb
21
+ shoulda_matchers_config.rb
22
+ devise_config.rb
23
+ system_tests_config.rb
24
+ faker_config.rb
25
+ }
26
+ end
27
+
28
+ before(:all) do
29
+ drop_dummy_database
30
+ remove_project_directory
31
+ create_dummy_project(devise: true)
32
+ end
33
+
34
+ it { expect(gemfile_content).to include("gem 'rspec-rails'") }
35
+ it { expect(gemfile_content).to include('rspec-rails') }
36
+ it { expect(gemfile_content).to include('factory_bot_rails') }
37
+ it { expect(gemfile_content).to include('faker') }
38
+ it { expect(gemfile_content).to include('guard-rspec') }
39
+ it { expect(gemfile_content).to include('rspec-nc') }
40
+ it { expect(gemfile_content).to include('shoulda-matchers') }
41
+ it { expect(gemfile_content).to include('capybara') }
42
+ it { expect(gemfile_content).to include('webdrivers') }
43
+
44
+ it { expect(rails_helper_content).to include("require 'spec_helper'") }
45
+ it { expect(rails_helper_content).to include("config.filter_run_when_matching :focus") }
46
+
47
+ it { expect(rspec_content).to include("--require rails_helper") }
48
+ it { expect(Dir.entries("#{project_path}/spec/support")).to include(*support_directories) }
49
+ it { expect(Dir.entries("#{project_path}/spec/support/configurations")).to include(*conf_files) }
50
+
51
+ it { expect(IO.read("#{project_path}/bin/rspec")).to include('path("rspec-core", "rspec")') }
52
+ it { expect(IO.read("#{project_path}/Guardfile")).to include(':rspec, cmd: "bin/rspec"') }
53
+ it { expect(IO.read("#{project_path}/bin/guard")).to include('path("guard", "guard")') }
54
+
55
+ it { expect(IO.read("#{project_path}/README.md")).to include("To run unit test") }
56
+ end
@@ -17,12 +17,11 @@ module PotassiumTestHelpers
17
17
 
18
18
  def create_dummy_project(arguments = {})
19
19
  Dir.chdir(tmp_path) do
20
- Bundler.with_clean_env do
20
+ Bundler.with_unbundled_env do
21
21
  add_fakes_to_path
22
22
  add_project_bin_to_path
23
23
  full_arguments = hash_to_arguments(create_arguments(true).merge(arguments))
24
24
  run_command("#{potassium_bin} create #{APP_NAME} #{full_arguments}")
25
- on_project { run_command("hound rules update ruby --local") }
26
25
  end
27
26
  end
28
27
  end
@@ -47,7 +46,7 @@ module PotassiumTestHelpers
47
46
 
48
47
  def on_project(&block)
49
48
  Dir.chdir(project_path) do
50
- Bundler.with_clean_env do
49
+ Bundler.with_unbundled_env do
51
50
  block.call
52
51
  end
53
52
  end
data/tmp/.keep ADDED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: potassium
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - juliogarciag
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-22 00:00:00.000000000 Z
11
+ date: 2022-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,16 +86,30 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.65.0
89
+ version: '1.9'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.65.0
96
+ version: '1.9'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rubocop-rspec
98
+ name: rubocop-performance
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rails
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - ">="
@@ -108,6 +122,20 @@ dependencies:
108
122
  - - ">="
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '2.2'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '2.2'
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: gems
113
141
  requirement: !ruby/object:Gem::Requirement
@@ -184,14 +212,14 @@ dependencies:
184
212
  requirements:
185
213
  - - "~>"
186
214
  - !ruby/object:Gem::Version
187
- version: 6.0.2
215
+ version: 6.1.4.4
188
216
  type: :runtime
189
217
  prerelease: false
190
218
  version_requirements: !ruby/object:Gem::Requirement
191
219
  requirements:
192
220
  - - "~>"
193
221
  - !ruby/object:Gem::Version
194
- version: 6.0.2
222
+ version: 6.1.4.4
195
223
  - !ruby/object:Gem::Dependency
196
224
  name: semantic
197
225
  requirement: !ruby/object:Gem::Requirement
@@ -216,10 +244,12 @@ extensions: []
216
244
  extra_rdoc_files: []
217
245
  files:
218
246
  - ".circleci/config.yml"
247
+ - ".circleci/setup-rubygems.sh"
219
248
  - ".editorconfig"
220
249
  - ".gitignore"
221
250
  - ".node-version"
222
251
  - ".rspec"
252
+ - ".rubocop.yml"
223
253
  - ".ruby-version"
224
254
  - CHANGELOG.md
225
255
  - Gemfile
@@ -241,17 +271,17 @@ files:
241
271
  - lib/potassium/assets/.pryrc
242
272
  - lib/potassium/assets/.rubocop.yml
243
273
  - lib/potassium/assets/.stylelintrc.json
244
- - lib/potassium/assets/Dockerfile.ci
245
274
  - lib/potassium/assets/Makefile.erb
246
275
  - lib/potassium/assets/Procfile
247
276
  - lib/potassium/assets/README.md.erb
248
277
  - lib/potassium/assets/README.yml
249
278
  - lib/potassium/assets/active_admin/admin-component.vue
250
279
  - lib/potassium/assets/active_admin/admin_application.js
251
- - lib/potassium/assets/active_admin/admin_user_policy.rb
252
- - lib/potassium/assets/active_admin/comment_policy.rb
253
280
  - lib/potassium/assets/active_admin/init_activeadmin_vue.rb
254
- - lib/potassium/assets/active_admin/pundit_page_policy.rb
281
+ - lib/potassium/assets/active_admin/policies/admin_user_policy.rb
282
+ - lib/potassium/assets/active_admin/policies/comment_policy.rb
283
+ - lib/potassium/assets/active_admin/policies/default_policy.rb
284
+ - lib/potassium/assets/active_admin/policies/page_policy.rb
255
285
  - lib/potassium/assets/app/graphql/graphql_controller.rb
256
286
  - lib/potassium/assets/app/graphql/mutations/login_mutation.rb
257
287
  - lib/potassium/assets/app/graphql/queries/base_query.rb
@@ -269,7 +299,8 @@ files:
269
299
  - lib/potassium/assets/app/mailers/application_mailer.rb
270
300
  - lib/potassium/assets/app/uploaders/base_uploader.rb
271
301
  - lib/potassium/assets/app/uploaders/image_uploader.rb
272
- - lib/potassium/assets/bin/cibuild.erb
302
+ - lib/potassium/assets/app/views/shared/_gtm_body.html.erb
303
+ - lib/potassium/assets/app/views/shared/_gtm_head.html.erb
273
304
  - lib/potassium/assets/bin/release
274
305
  - lib/potassium/assets/bin/setup.erb
275
306
  - lib/potassium/assets/bin/setup_heroku.erb
@@ -283,7 +314,6 @@ files:
283
314
  - lib/potassium/assets/config/sentry.rb.erb
284
315
  - lib/potassium/assets/config/shrine.rb
285
316
  - lib/potassium/assets/config/storage.yml
286
- - lib/potassium/assets/docker-compose.ci.yml
287
317
  - lib/potassium/assets/docker-compose.yml
288
318
  - lib/potassium/assets/es-CL.yml
289
319
  - lib/potassium/assets/lib/tasks/auto_annotate_models.rake
@@ -295,10 +325,16 @@ files:
295
325
  - lib/potassium/assets/seeds/seeds.rb
296
326
  - lib/potassium/assets/sidekiq.rb.erb
297
327
  - lib/potassium/assets/sidekiq.yml
298
- - lib/potassium/assets/sidekiq_scheduler.yml
299
328
  - lib/potassium/assets/testing/.rspec
329
+ - lib/potassium/assets/testing/devise_config.rb
330
+ - lib/potassium/assets/testing/factory_bot_config.rb
331
+ - lib/potassium/assets/testing/faker_config.rb
300
332
  - lib/potassium/assets/testing/platanus.png
333
+ - lib/potassium/assets/testing/power_types_config.rb
301
334
  - lib/potassium/assets/testing/rails_helper.rb
335
+ - lib/potassium/assets/testing/shoulda_matchers_config.rb
336
+ - lib/potassium/assets/testing/simplecov_config.rb
337
+ - lib/potassium/assets/testing/system_tests_config.rb
302
338
  - lib/potassium/cli.rb
303
339
  - lib/potassium/cli/commands/create.rb
304
340
  - lib/potassium/cli/commands/install.rb
@@ -326,6 +362,7 @@ files:
326
362
  - lib/potassium/recipes/better_errors.rb
327
363
  - lib/potassium/recipes/ci.rb
328
364
  - lib/potassium/recipes/cleanup.rb
365
+ - lib/potassium/recipes/coverage.rb
329
366
  - lib/potassium/recipes/data_migrate.rb
330
367
  - lib/potassium/recipes/database.rb
331
368
  - lib/potassium/recipes/database_container.rb
@@ -337,10 +374,12 @@ files:
337
374
  - lib/potassium/recipes/file_storage.rb
338
375
  - lib/potassium/recipes/front_end.rb
339
376
  - lib/potassium/recipes/github.rb
377
+ - lib/potassium/recipes/google_tag_manager.rb
340
378
  - lib/potassium/recipes/heroku.rb
341
379
  - lib/potassium/recipes/i18n.rb
342
380
  - lib/potassium/recipes/listen.rb
343
381
  - lib/potassium/recipes/mailer.rb
382
+ - lib/potassium/recipes/monitoring.rb
344
383
  - lib/potassium/recipes/node.rb
345
384
  - lib/potassium/recipes/power_types.rb
346
385
  - lib/potassium/recipes/pry.rb
@@ -354,6 +393,7 @@ files:
354
393
  - lib/potassium/recipes/script.rb
355
394
  - lib/potassium/recipes/secrets.rb
356
395
  - lib/potassium/recipes/seeds.rb
396
+ - lib/potassium/recipes/spring.rb
357
397
  - lib/potassium/recipes/style.rb
358
398
  - lib/potassium/recipes/testing.rb
359
399
  - lib/potassium/recipes/tzinfo.rb
@@ -371,6 +411,7 @@ files:
371
411
  - spec/features/api_spec.rb
372
412
  - spec/features/background_processor_spec.rb
373
413
  - spec/features/ci_spec.rb
414
+ - spec/features/coverage_spec.rb
374
415
  - spec/features/data_migrate_spec.rb
375
416
  - spec/features/database_container_spec.rb
376
417
  - spec/features/database_spec.rb
@@ -379,6 +420,7 @@ files:
379
420
  - spec/features/file_storage_spec.rb
380
421
  - spec/features/front_end_spec.rb
381
422
  - spec/features/github_spec.rb
423
+ - spec/features/google_tag_manager_spec.rb
382
424
  - spec/features/graphql_spec.rb
383
425
  - spec/features/heroku_spec.rb
384
426
  - spec/features/i18n_spec.rb
@@ -386,13 +428,16 @@ files:
386
428
  - spec/features/new_project_spec.rb
387
429
  - spec/features/node_spec.rb
388
430
  - spec/features/power_types_spec.rb
431
+ - spec/features/pundit_spec.rb
389
432
  - spec/features/schedule_spec.rb
433
+ - spec/features/testing_spec.rb
390
434
  - spec/features/vue_admin_spec.rb
391
435
  - spec/spec_helper.rb
392
436
  - spec/support/fake_github.rb
393
437
  - spec/support/fake_heroku.rb
394
438
  - spec/support/fake_octokit.rb
395
439
  - spec/support/potassium_test_helpers.rb
440
+ - tmp/.keep
396
441
  homepage: https://github.com/platanus/potassium
397
442
  licenses:
398
443
  - MIT
@@ -412,7 +457,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
412
457
  - !ruby/object:Gem::Version
413
458
  version: '0'
414
459
  requirements: []
415
- rubygems_version: 3.1.2
460
+ rubygems_version: 3.2.22
416
461
  signing_key:
417
462
  specification_version: 4
418
463
  summary: An application generator from Platanus
@@ -422,6 +467,7 @@ test_files:
422
467
  - spec/features/api_spec.rb
423
468
  - spec/features/background_processor_spec.rb
424
469
  - spec/features/ci_spec.rb
470
+ - spec/features/coverage_spec.rb
425
471
  - spec/features/data_migrate_spec.rb
426
472
  - spec/features/database_container_spec.rb
427
473
  - spec/features/database_spec.rb
@@ -430,6 +476,7 @@ test_files:
430
476
  - spec/features/file_storage_spec.rb
431
477
  - spec/features/front_end_spec.rb
432
478
  - spec/features/github_spec.rb
479
+ - spec/features/google_tag_manager_spec.rb
433
480
  - spec/features/graphql_spec.rb
434
481
  - spec/features/heroku_spec.rb
435
482
  - spec/features/i18n_spec.rb
@@ -437,7 +484,9 @@ test_files:
437
484
  - spec/features/new_project_spec.rb
438
485
  - spec/features/node_spec.rb
439
486
  - spec/features/power_types_spec.rb
487
+ - spec/features/pundit_spec.rb
440
488
  - spec/features/schedule_spec.rb
489
+ - spec/features/testing_spec.rb
441
490
  - spec/features/vue_admin_spec.rb
442
491
  - spec/spec_helper.rb
443
492
  - spec/support/fake_github.rb
@@ -1,6 +0,0 @@
1
- FROM platanus/ruby:2.7
2
-
3
- RUN mkdir /app
4
- WORKDIR /app
5
-
6
- ADD . /app
@@ -1,2 +0,0 @@
1
- class AdminUserPolicy < ApplicationPolicy
2
- end
@@ -1,2 +0,0 @@
1
- class ActiveAdmin::CommentPolicy < ApplicationPolicy
2
- end
@@ -1,5 +0,0 @@
1
- class ActiveAdmin::PagePolicy < ApplicationPolicy
2
- def show?
3
- true
4
- end
5
- end
@@ -1,117 +0,0 @@
1
- #!/usr/bin/env bash
2
- trap "exit" SIGINT SIGTERM
3
-
4
- command -v docker >/dev/null 2>&1 && docker info >/dev/null || {
5
- printf >&2 "\e[31mI require docker but it's not installed. Aborting.\e[0m\n"; exit 1;
6
- }
7
-
8
- DOCKER_COMPOSE_ARGS="-f docker-compose.ci.yml"
9
-
10
- # Build Image
11
- build(){
12
- docker-compose $DOCKER_COMPOSE_ARGS build test
13
- }
14
-
15
- # Wait services to be ready
16
- wait_services(){
17
- function test_service {
18
- docker-compose $DOCKER_COMPOSE_ARGS run --rm test sh -c "nc -z $1 $2"
19
- }
20
-
21
- count=0
22
- # Chain tests together by using &&
23
- until (
24
- <% if(selected?(:database, :mysql) || selected?(:database, :postgresql))-%>
25
- test_service '$DB_HOST' '$DB_PORT' && \
26
- <% end-%>
27
- echo "Services ready"
28
- )
29
- do
30
- ((count++))
31
- if [ $count -gt 50 ]
32
- then
33
- echo "Services didn't become ready in time"
34
- exit 1
35
- else
36
- echo "Waiting for services to become ready..."
37
- fi
38
- sleep 0.5
39
- done
40
- }
41
-
42
- # Prepare dependencies
43
- dependencies(){
44
- docker-compose $DOCKER_COMPOSE_ARGS run --rm test bundle install
45
- }
46
-
47
- <% if selected?(:front_end, :vue) %>
48
- yarn_dependencies(){
49
- docker-compose $DOCKER_COMPOSE_ARGS run --rm test yarn install
50
- }
51
- <% end %>
52
-
53
- assets() {
54
- docker-compose $DOCKER_COMPOSE_ARGS run --rm test /bin/bash -c "bin/setup && bundle exec rake assets:precompile"
55
- }
56
-
57
- # Prepare database
58
- database(){
59
- docker-compose $DOCKER_COMPOSE_ARGS run --rm test bundle exec rake db:create db:schema:load
60
- }
61
-
62
- # Run the specs
63
- tests(){
64
- [ -n "$CI" ] && {
65
- RSPEC_JUNIT_ARGS="-r rspec_junit_formatter --format RspecJunitFormatter -o $HOME/.rspec_reports/junit.xml"
66
- RSPEC_FORMAT_ARGS="--format progress --no-color"
67
- }
68
- docker-compose $DOCKER_COMPOSE_ARGS run --rm test bundle exec rspec spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
69
- }
70
-
71
- <% if selected?(:front_end, :vue) %>
72
- js_tests(){
73
- docker-compose $DOCKER_COMPOSE_ARGS run --rm test yarn run test
74
- }
75
- <% end %>
76
-
77
- # Run the complete ci build
78
- no_ci(){
79
- build
80
- wait_services
81
- dependencies
82
- assets
83
- database
84
- tests
85
- }
86
-
87
- case "$1" in
88
- "")
89
- no_ci
90
- ;;
91
- "services")
92
- wait_services
93
- ;;
94
- "deps"|"dependencies")
95
- dependencies <% if selected?(:front_end, :vue) %>&& yarn_dependencies<% end %>
96
- ;;
97
- "assets")
98
- assets
99
- ;;
100
- "db"|"database")
101
- database
102
- ;;
103
- <% if selected?(:front_end, :vue) %>
104
- "js_tests")
105
- js_tests
106
- ;;
107
- <% end %>
108
- "specs"|"tests")
109
- tests
110
- ;;
111
- "build")
112
- build
113
- ;;
114
- *)
115
- echo "Usage: cibuild [services|deps|assets|db|specs|build]"
116
- ;;
117
- esac
@@ -1,12 +0,0 @@
1
- version: '3.4'
2
-
3
- services:
4
- test:
5
- build:
6
- context: "."
7
- dockerfile: Dockerfile.ci
8
- volumes:
9
- - "test_data:/usr/local/bundle"
10
- - "./node_modules:/app/node_modules"
11
- environment:
12
- RACK_ENV: test
@@ -1,9 +0,0 @@
1
- production:
2
- :concurrency: 5
3
- :queues:
4
- - default
5
- # :schedule:
6
- # an_scheduled_task:
7
- # cron: '0 * * * * *' # Runs once per minute
8
- # class: ExampleJob
9
- # args: ['a', 'b']