はじめに RSpecを書くときに、shoulda-matchersというGemを使うと非常に便利でした。 shoulda-matchersとは Shoulda Matchers provides RSpec- and Minitest-compatible one-liners to test common Rails functionality that, if written by hand, would be much longer, more complex, and error-prone. Shoulda Matchersは、手書きで書くと長くて、複雑で、エラーが起きやすいRailsのテストをワンライナーにします。(意訳) ワンライナーって1行ってことでいいのでしょうか... 使用方法 このようなuserモデルに対し、