2. Testing on Rails
-
- Data to support the Tests
3.
-
- Every Application get's tested, eventually.
Why Test? 4. Why Automate Tests?
- Computer's are great at performing mundane repeatable
tasks.
- Automated Regression Testing.
5. Additional Benefits
-
- Writing Tests makes better Programmers.
-
- Automated Tests make better Applications.
- Tests are a great warm-up / practice area.
-
-
- With Unit Tests,...you actually stand a chance of producing a
product with close to zero defects.-The Pragmatic Programmer
- All the beautiful people write unit tests.
6. My Favorite Mistake
- # Warning: The database defined as'test' will be erasedand
- # re-generated from your development database when you run
'rake'.
- # Do not set this db to the same as development or
production.
- database: bathroom_attendant_test
7. Unit Testing Models
8. Methods Available
- assert_equalexpected, actual
- assert_instance_ofklass, object
9. Error vs. Failure
- test_truth(AttendantTest):
- Mysql::Error: #28000Access denied for user 'root'@'localhost'
(using password: NO)
- test_truth(AttendantTest)
[./test/unit/attendant_test.rb:8]:
- test_truth(QualificationTest):
- NameError: undefined local variable or method `duh' for #