So you’ve got the basics of Rails down, but you haven’t really done any testing. Never fear, this course will lead you through everything you need to know to start testing your Rails apps. All you need to bring is a laptop with Wi-Fi and a browser which isn’t Internet Explorer. All coding will be done through our web application, and there will be plenty of lab assistants to help you if you get stuck along the way.
* Test Unit basics
* Testing Rails models, using fixtures, and validation testing.
* Improving our testing code with macros, shoulda basics, and setup/teardown.
* Mocking and Stubbing with Mocha
* Testing the whole Rails stack with Capybara Integration tests
* Using Factory Girl to replace Fixtures
by Jared Ning
MiniTest is the no-nonsense testing framework you already know how to use. If we strive for cleaner and simpler code in our own work, wouldn't it be nice to have that in our test framework too? Whether you're a Test Unit fan or RSpec fan, you'll feel right at home using MiniTest. Its simplicity makes it fast, easy to use, extendable, and maybe most importantly, easy to understand. Plus, Rails 4 uses MiniTest.
by Noel Rappin
There’s all kinds of discussion on how to make test processes work, and how to make tests fast, but it sometimes seems like there’s not much discussion on how to make tests useful. What makes a BDD test valuable, in that it will save more time that it will cost in maintenance? I’ll claim that there are five things that you should look for in your tests: independence, repeatability, clarity, conciseness, and robustness. These features will make the tests easier to write, easier to verify, and easier to keep consistent as your application becomes more complicated. You’ll leave this talk ready and able to write great tests.
“A testing tool by any other other name would assert as truthy.” – some guy. You’ve seen Rails’ built-in Test::Unit in the morning session. This afternoon, we’ll introduce RSpec, another popular testing tool. We’ll overview basic structure, contexts, “should” expectations, mocking and stubbing. We’ll also cover Rails model, view, controller, routing, helper, and request specs.
23rd–25th April 2012