rspecメモ
validate_presence_of
shoulda-matchersの仕組み。バリデーションをチェックするために利用
NoMethodErrorになる時は、type: :modelが必要
code: hoge.rb
describe Hoge::Hoge,type: :model do
end
aggregate_failures
それぞれを独自のexapmpleに分割することなく、期待値のセット全体からすべての失敗を見ることができる
code: example_spec.rb
aggregate_failures("verifying response") do
expect(response.status).to eq(200)
expect(response.headers).to include("Content-Type" => "text/plain")
expect(response.body).to include("Success")
end