spec/server/spec_helper.rb in stockor-0.4.0 vs spec/server/spec_helper.rb in stockor-0.5.0

- old
+ new

@@ -1,9 +1,12 @@ -require 'skr' -require 'lanes/spec_helper' -require 'webmock/minitest' -require 'vcr' +require 'lanes' +Lanes.silence_logs do + require 'skr' + require 'lanes/spec_helper' + require 'webmock/minitest' + require 'vcr' +end class Lanes::TestCase include Skr end @@ -20,27 +23,25 @@ end end module StockorFixtureTestPatches - extend ActiveSupport::Concern - included do - alias_method_chain :table_rows, :custom_autoset_stockor_fields - end - - def table_rows_with_custom_autoset_stockor_fields - results = table_rows_without_custom_autoset_stockor_fields + def table_rows + results = super if model_class && model_class < ActiveRecord::Base results[ table_name ].each do | row | if self['hash_code'].blank? && model_class.column_names.include?('hash_code') row['hash_code'] = Lanes::Strings.random(8) end end end results end end + +ActiveRecord::FixtureSet.prepend StockorFixtureTestPatches + VCR_OPTS = { record: :none }