Test on Rails ✘╹◡╹✘

089127ffb92a19d3d37815673cca06dc?s=47 r7kamura
September 19, 2012

Test on Rails ✘╹◡╹✘

089127ffb92a19d3d37815673cca06dc?s=128

r7kamura

September 19, 2012
Tweet

Transcript

  1. 1.

    Test on Rails based on “Rails Test Prescriptions” by Noel

    Rappin Ryo Nakamura (@r7kamura) ✘ ╹◡╹ ✘
  2. 4.

    * to speed up validation * to design architectures *

    to assure its quality ... Why test?
  3. 5.

    to speed up validation automating test * open browser... *

    type the URL “h..tt..p://...” * check the contents...
  4. 6.

    to design architecture * write clean and independent code (test

    behaves like a third-party code) * think the correct behavior of code (this would be an example of test)
  5. 7.

    to assure its quality * prevent code from enbugging *

    maybe forced to write test ... ;(
  6. 12.

    Unit Test of Model. It's easy to write Model Test.

    "Skinny Controller, Fat Model" Model Test
  7. 14.

    Functional tests Verify the system satisfies requested features of user.

    In Rails, it tests Controller & View by 1 request
  8. 16.

    1. normal A normal request should pass expected data to

    the view. @foo, sessions, cookies, flash
  9. 20.
  10. 21.

    View Test Verify: * logic * structure (semantic mean) Used

    in Controller & Integration Test on Rails
  11. 22.

    Good targets * logic in a view (necessary evil...;) *

    security problem * way to render structures
  12. 23.

    Bad targets * text in HTML tag * look and

    feel verify only “semantic meanings”
  13. 27.

    Good targets * interactions in multiple steps * dependency with

    prev state * legacy code (black-box) * with JavaScript