I read "** Everyday Rails-Introduction to Rails Testing with RSpec **" to learn RSpec, which is familiar to Rails programmers, so I will summarize it as my own output.
It is one of the test frameworks of Ruby on Rails, and its biggest feature is that it is easy to read and write and it is possible to implement tests efficiently. Other typical test frameworks for Ruby on Rails include the Rails standard MiniTest and test-unit. In RSpec, the test code is called ** spec **.
・ Ruby 2.6.3 ・ Ruby on Rails 5.1
The following article summarizes what I learned in "Everyday Rails-Introduction to Rails Testing with RSpec". -Test, RSpec -RSpec Setup ・ Model Spec -Create test data with FactoryBot -Controller spec ・ System Spec ・ Request specifications ・ Keep specs at DRY ・ Fast writing test, fast working test ・ Other tests ・ TDD (Test Driven Development)
Recommended Posts