move quiz faker to new dev utilities location

This commit is contained in:
Mark Moser 2017-03-02 10:36:10 -06:00
parent 3ff03a03ad
commit c4357055d7
4 changed files with 5 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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__)