{"height":"190","version":"1.0","provider_name":"Hatena Blog","categories":["rails","\u4e00\u4eba\u8aad\u66f8\u4f1a","rspec"],"author_name":"maeshima","blog_title":"maeshima\u306e\u65e5\u8a18","description":"Rails controller \u306e spec \u306e\u66f8\u304d\u65b9\u306b\u3064\u3044\u3066\u3002 25.1 Controller Specs ModelName.new \u3082\u758e\u7d50\u5408\u306e\u305f\u3081\u306bstub\u3092\u5b9f\u88c5\u3057\u305f\u307b\u3046\u304c\u3044\u3044\u3002 mock_model\u3063\u3066\u306a\u3093\u3060\u3063\u3051 -> new_record?\u3084id\u306a\u3069\u306e\u57fa\u672c\u7684\u306astub\u304c\u3064\u3044\u3066\u308bmock adding context specific examples \u6210\u529f\u6642\u3001\u5931\u6557\u6642\u305d\u308c\u305e\u308c\u306espec\u3092\u304b\u304f\u3002 what we just did require 'spec_helper' \u306f\u5fd8\u308c\u305a\u306b\u3002controller\u306espec\u3067\u4f7f\u308f\u308c\u308b\u30e1\u30bd\u30c3\u30c9\u306f\u4e3b\u306bActionControlelr::TestCa\u2026","published":"2010-07-11 00:08:07","width":"100%","image_url":null,"url":"https://maeshima.hateblo.jp/entry/20100711/1278860887","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmaeshima.hateblo.jp%2Fentry%2F20100711%2F1278860887\" title=\"Chapter 25 Rails Controllers - maeshima\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/maeshima/","type":"rich","blog_url":"https://maeshima.hateblo.jp/","title":"Chapter 25 Rails Controllers"}