require "#{File.dirname(__FILE__)}/../test_helper" describe EnrichmentDb::Census::Datum do it 'should retrieve correct record' do result = EnrichmentDb::Census::Datum.by_id('selected_medians_and_averages', '3000') assert_equal 3000, result['region_id'] assert_equal 'Postcodes', result['region_type'] assert_equal 26, result['median_age_of_persons'] end it 'should find postcode in census data but not in our database so return nil' do result = EnrichmentDb::Census::Datum.by_id('selected_medians_and_averages', '6079') assert_nil result end end