diff --git a/config/application.rb b/config/application.rb index 98b8077..ea7c038 100644 --- a/config/application.rb +++ b/config/application.rb @@ -30,5 +30,8 @@ module SkillAssessmentApp g.helper false g.routes false end + + # let's use lib/utils for dev only utility classes & helpers + config.autoload_paths << "#{Rails.root}/lib/utils" end end diff --git a/lib/tasks/faker.rake b/lib/tasks/faker.rake deleted file mode 100644 index 1d27021..0000000 --- a/lib/tasks/faker.rake +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true -namespace :faker do - desc "Generates 10 fake candidates with results." - task results: :environment do - puts "Not for production use" and return if Rails.env == "production" - - faker = FakeQuiz.new - faker.create_completed_quizzes 10 - end -end diff --git a/app/services/fake_quiz.rb b/lib/utils/fake_quiz.rb similarity index 98% rename from app/services/fake_quiz.rb rename to lib/utils/fake_quiz.rb index 6929504..835305f 100644 --- a/app/services/fake_quiz.rb +++ b/lib/utils/fake_quiz.rb @@ -1,5 +1,4 @@ # frozen_string_literal: true -# :nocov: class FakeQuiz def create_completed_quizzes num = 10 num.times do @@ -68,4 +67,3 @@ class FakeQuiz end end # rubocop:enable Metrics/MethodLength end -# :nocov: diff --git a/test/test_helper.rb b/test/test_helper.rb index 108c430..275642d 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -8,6 +8,8 @@ SimpleCov.start 'rails' do add_group 'Services & Workers', %w(app/workers app/services) add_group "Jobs", 'app/jobs' add_group "Policies", 'app/policies' + + add_filter "/lib/utils/" # no need to test dev only utility classes end require File.expand_path('../../config/environment', __FILE__)