Skip to content

Commit

Permalink
Add gemfile group for testing a production-like deployment
Browse files Browse the repository at this point in the history
 * Add production_test gemfile group, to cover gems that are not strictly
   needed in production, but still required to test a production-like
   deployment; an example is 'faker', to seed the database with test data
 * Fix rubric rake task to avoid faker-ruby/faker#278 when run in a production
   environment
  • Loading branch information
adisandro committed Apr 28, 2016
1 parent a21575d commit 5bb320a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ end
# listed here
group :development, :test do
gem 'byebug', :platforms => [:mri_20, :mri_21]
end

# Gems needed (wanted) for development, test and production_test
# can be listed here
# production_test is for testing a production-like deployment,
# but using a seeded database
group :development, :test, :production_test do
gem 'faker' # required for database seeding
end

Expand Down
1 change: 1 addition & 0 deletions lib/tasks/rubric.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace :db do
task :rubric => :environment do
puts 'Add Rubric To Assignments'
require 'faker'
I18n.reload!

def pos_rand(range)
rand(range) + 1
Expand Down

0 comments on commit 5bb320a

Please # to comment.