diff --git a/config/initializers/country_config.rb b/config/initializers/country_config.rb index 4657f5d92d..d4a111fd56 100644 --- a/config/initializers/country_config.rb +++ b/config/initializers/country_config.rb @@ -83,9 +83,7 @@ class CountryConfig }.with_indifferent_access.freeze class << self - include Memery - - memoize def dhis2_data_elements + def dhis2_data_elements YAML.load_file(ENV.fetch("DHIS2_DATA_ELEMENTS_FILE")).with_indifferent_access end end diff --git a/spec/exporters/dhis2/ethiopia_exporter_spec.rb b/spec/exporters/dhis2/ethiopia_exporter_spec.rb index 564a51709e..e3efb0ba19 100644 --- a/spec/exporters/dhis2/ethiopia_exporter_spec.rb +++ b/spec/exporters/dhis2/ethiopia_exporter_spec.rb @@ -50,7 +50,9 @@ end data_value_sets = double - allow(Dhis2.client).to receive(:data_value_sets).and_return(data_value_sets) + dhis2_client = double + allow(Dhis2).to receive(:client).and_return(dhis2_client) + allow(dhis2_client).to receive(:data_value_sets).and_return(data_value_sets) expect(data_value_sets).to receive(:bulk_create).with(data_values: expected_values[0]) expect(data_value_sets).to receive(:bulk_create).with(data_values: expected_values[1]) Dhis2::EthiopiaExporter.export