{"published":"2013-07-13 14:55:09","blog_title":"Programmer_Mixin_Conductor's Blog ","categories":["rails","test"],"width":"100%","image_url":null,"title":"\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\uff1aassert_difference","type":"rich","author_url":"https://blog.hatena.ne.jp/jumperson/","description":"rails\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002 \u6b21\u306e\u3088\u3046\u306a\u3068\u3053\u308d\u3067\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002 \u25c6create\u306e\u30c6\u30b9\u30c8 assert_difference('Product.count') do post :create, product: @update end \u25c6destroy\u306e\u30c6\u30b9\u30c8 assert_difference('Product.count', -1) do delete :destroy, id: @product end \u8981\u3059\u308b\u306b\u3001assert_difference\u30e1\u30bd\u30c3\u30c9\u306e\u7b2c1\u5f15\u6570\u306b\u6e21\u3057\u305f\u30e1\u30bd\u30c3\u30c9\u306e\u5024\u304c\u3001\u30d6\u30ed\u30c3\u30af\u5185\u3067\u5909\u66f4\u3055\u308c\u308b\u3053\u3068\u3092\u691c\u8a3c\u3057\u307e\u3059\u3002 \u7b2c2\u5f15\u6570\u306b\u5909\u66f4\u3055\u308c\u308b\u2026","url":"https://jumperson.hatenablog.com/entry/2013/07/13/145509","version":"1.0","provider_url":"https://hatena.blog","author_name":"jumperson","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjumperson.hatenablog.com%2Fentry%2F2013%2F07%2F13%2F145509\" title=\"\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\uff1aassert_difference - Programmer_Mixin_Conductor&#39;s Blog \" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","blog_url":"https://jumperson.hatenablog.com/"}