Testing Trailblazer applications usually involves the following tests.
Integration tests for controllers. These Smoke tests only test the wiring between controller, operation and presentation layer. Usually, a coded click path simulates you manually clicking through your app and testing if it works.
The preferred way here is using Rack-test and Capybara.
Even though the Trailblazer book uses MiniTest for its test suite, Trailblazer can be tested with any framework. Usually, this will be Rspec.
Invoking operations works identical to MiniTest.
You’re free to use your matchers, your testing style, your way of structuring describe
or specify
, and so on.
!!! TODO: Example for smoke tests.
To write unit tests for your cells, please install the rspec-cells gem.
Learn more about Rspec and Cells.