 More accurate testing of the item for its fineness or purity can be done through the use of differing strengths of aqua regia and comparative testing of gold items of known fineness.The figurative meaning of the expression, where it is applied to tests of character, or definitive tests to other materials, became popular during and after the California Gold Rush, but was current before then, as shown by this quote from the Wisconsin paper "The Columbia Reporter", November 1845