~/talk

Secrets of Testing Rails 5 apps

Talkat RailsConf 2016 · 2016-05-04..05-06· [ruby-on-rails, testing]
links:none on file
slides:none on file

Rails 5 gives concrete testing changes: a new Test Runner invoked via bin/rails test (powered by Minitest 5 plugins) that prints runnable failing lines, supports -f and -b, and enables colored output; generated controller tests use ActionDispatch::IntegrationTest by default (assign/assert_template deprecated and extractable to rails-controller-testing); API tests get request encoders (as: :json) and response parsing via parsed_body; Active Job uses the async adapter in test, test order is randomized, and new helpers like file_fixture reduce boilerplate.

AI-written summary · about

  1. 0:00SECRETS OF TESTING RAILS 5 APPS
  2. 0:21BIGBinary
  3. 2:19the way we test code
  4. 2:31the way we run tests
  5. 3:01Recap
  6. 3:56Limitations
  7. 5:22Test Runner
  8. 5:40bin/rails test
  9. 6:21Rerun snippets
  10. 7:00Documentation
  11. 7:53Running multiple tests
  12. 9:38Fail fast
  13. 10:05Colored output
  14. 10:29Minitest 5
  15. 11:15Inspirations
  16. 14:45Integration tests are slow
  17. 15:43Close to real world
  18. 16:30Rails 5 generates integration controller tests
  19. 16:44Old apps?
  20. 16:58Backward compatible
  21. 17:27Action Controller::Test Case gem
  22. 17:53Implications
  23. 22:10status code
  24. 22:28can't test instance variables
  25. 22:40can't test which template rendered
  26. 23:35test actual HTML
  27. 24:11Not just testing controller action
  28. 24:25Controller + View
  29. 25:08There is a space between controller and views
  30. 25:39Controller View interface
  31. 26:35Why do we test controller internals
  32. 28:00Interface testing
  33. 28:26Testing controllers the old way
  34. 30:03Controller via engine
  35. 31:10Testing API apps
  36. 32:43Request Encoding
  37. 35:41Active Job Async adapter
  38. 36:49Random test ordering
  39. 41:05Request methods
  40. 41:19Better experience
  41. 41:43Happy testing!
  42. 42:00With Rails default test stack
  43. 42:18Rails 5 Blog Series Rails%205
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.