Skip to content

Instantly share code, notes, and snippets.

@cfitz
Last active January 28, 2020 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfitz/016ea06748fa40f14125ebe80d16fd7e to your computer and use it in GitHub Desktop.
Save cfitz/016ea06748fa40f14125ebe80d16fd7e to your computer and use it in GitHub Desktop.
# config/initializers/e2e_test.rb
# For some situations, we need to have the e2e
# test to behave different in order to speed up the tests.
# rubocop:disable Style/ClassVars
if ENV.fetch('E2E_TEST', 'false') == 'true'
require_relative '../../lib/util/az_list_controller_util'
module Util
class AzListControllerUtil
class << self
@@solr_json = JSON.parse(
IO.read(
Rails.root.join('test/fixtures/files/e2e_all_products.json')
)
).collect(&:with_indifferent_access)
def solr_results_in_alphabetical_order
Rails.logger.info('WARNING: USING E2E PATCH OF Util::AzListControllerUtil ')
@@solr_json
end
end
end
end
end
# rubocop:enable Style/ClassVars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment