Refactoring is the process of
changing a software system
in such a way that it
does not alter the external behavior
of the code
yet improves the internal structure.
Tests give you confidence to refactor constantly
Tests help defer design decisions and abstractions because they focus on the interface
Tests expose design flaws:
when the design is bad,
testing is hard
Mais ça peut vite coûter cher
INTEGRATION
UNITAIRES
Tester les "cas autoroutes" en haut
les cas particuliers en bas
quand même vérifier l'intégration !
Pour commencer: FAIRE DES TESTS FACILES
le plus important, c'est de chopper le réflexe !
rails g rspec:install
config.generators do |g|
g.test_framework :rspec,
:fixtures => true,
:view_specs => true,
:helper_specs => true,
:routing_specs => true,
:controller_specs => true,
:request_specs => true;
g.fixture_replacement :factory_girl, :dir => "spec/factories"
end