diff --git a/config/schedule.rb b/config/schedule.rb index 3685d68c47..9ad169cacf 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -16,10 +16,6 @@ every 1.day, at: '01:00am' do rake 'ofn:cache:check_products_integrity' end -every 1.day, at: '12:05am' do - run_file "lib/open_food_network/integrity_checker.rb" -end - every 1.day, at: '2:45am' do rake 'db2fog:clean' if ENV['S3_BACKUPS_BUCKET'] end diff --git a/lib/open_food_network/integrity_checker.rb b/lib/open_food_network/integrity_checker.rb deleted file mode 100644 index 4bf4444c14..0000000000 --- a/lib/open_food_network/integrity_checker.rb +++ /dev/null @@ -1,22 +0,0 @@ -require 'rspec/rails' -require 'rspec/autorun' - -# This spec file is one part of a two-part strategy to maintain data integrity. The first part -# is to proactively protect data integrity using database constraints (not null, foreign keys, -# etc) and ActiveRecord validations. As a backup to those two techniques, and particularly in -# the cases where it's not possible to model an integrity concern with database constraints, -# we can add a reactive integrity test here. - -# These tests are run nightly and the results are emailed to the MAILTO address in -# config/schedule.rb if any failures occur. - -# Ref: http://pluralsight.com/training/Courses/TableOfContents/database-your-friend - -describe "data integrity" do - it "has no deleted variants in order cycles" do - # When a variant is soft deleted, it should be removed from all order cycles - # via Spree::Product#delete or Spree::Variant#delete. - evs = ExchangeVariant.joins(:variant).where('spree_variants.deleted_at IS NOT NULL') - evs.count.should == 0 - end -end