This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# C'est très bien, j'ai apporté une simple somplification, inutile d'invoquer #save quand | |
# l'introspection API te donne #valid?. N'oublions jamais, nous testons nos applications, et *pas* *Rails*. | |
# | |
# Par contre Shoulda fait déjà tout ça pour toi, je te montre comment ci-dessous. | |
# Generate generic tests for instance and unsaved objects | |
# object as String | |
# uniqueness_attr as Array | |
# model_generic_tests("account", %w(name)) | |
def model_generic_tests(object, uniqueness_attr=[]) |