rspecã使ã£ã¦ã³ã³ããã¼ã©ã®ãã¹ããæ¸ãéããã¡ã¤ã«ã®ã¢ãããã¼ãã試ããããã¨ãããã¾ãã é å¼µã£ã¦ActionDispatch::Http::UploadedFile.new()ãªã©ã¨ãã¦ããstringã«å¤æããã¦ãã¾ãã®ã§ãã¡ã§ããã <%= form_for @user do |f| %> <%= f.text_field :name %> <%= f.file_field :image %> <% end %> ä¸è¨ã®ãããªHTMLããrspecã§ã·ãã¥ã¬ã¼ãããã«ã¯ã以ä¸ã®ããã«ãã¾ãã Rails 3.1ã®ç°å¢ã§è©¦ãã¾ããã describe UsersController do describe âPOST usersâ do it âshould be successfulâ do filepath = â/home/baba/avatar.jpgâ post âc
{{#tags}}- {{label}}
{{/tags}}