â [Rails] fixture ããªãã¼ããã 19:25 Rails ã® fixtures ã£ã¦ãã£ãã·ã¥ãããã®ã§ãä¾ãã° ãã¼ã¿ããå¼ã³åºã ãã¼ã¿ãæ´æ° æ´æ°ãããå
容ããã§ã㯠ã¨ãã£ãå¦çãããããããªå ´åã fixtures :users def setup @request.session[:user] = users(:first) end def test_update post :update assert_equal 'hoge', User.find(users(:first).id).name end ã¿ãããªæãã§æ¸ãã¦ãããã ãã©ãé¢åãªã®ã§ãã£ã¨è¯ãæ¹æ³ç¡ãããªã¨æã£ã¦ã½ã¼ã¹ãèªãã ãã users(:first, true) ã¨ãã風㫠true ãä»ããã¨ãã£ãã·ã¥ãæ¶ãã¦èªã¿ç´ãã¦ãããããããç¥ãããã£ããã
{{#tags}}- {{label}}
{{/tags}}