frozen_record icon indicating copy to clipboard operation
frozen_record copied to clipboard

`TestHelper.load_fixture` should fail if attributes don't match

Open ragalie opened this issue 1 year ago • 1 comments

I ran into an issue today where tests were failing because the FrozenRecord object lacked a method that the calling code expected to be present.

This happened because while the production YAML file had been updated to include a new attribute, no record in the test fixture had it.

How would you feel about updating load_fixture to raise an error if the attributes in the test file don't match the attributes already present on the model class? Perhaps failing like this is an option to load_records?

ragalie avatar Dec 09 '24 21:12 ragalie

Sure. Sounds like a good idea. PR welcome.

byroot avatar Dec 09 '24 22:12 byroot