JBuilderãè¿å´ããbodyãRSpecã§åå¾ã§ããªã件
Railsã§APIãä½ã£ã¦ããæãJBuilderãè¿å´ããå¤ããã¹ããããã¨ã¯ãããããã¨æãã¾ãã
RSpecã«ã¦ãresponse.bodyãã«å ¥ã£ã¦ããå¤ãåå¾ãããã¨ããã¨ãããä½ãå ¥ã£ã¦ããªãåé¡ã«ééãã¾ããã
RailsãRSpecã®ãã¼ã¸ã§ã³ã¯ä»¥ä¸ã®éãã§ãã
ã»Rails 4.2.1
ã»RSpec 3.2.3
解決æ¹æ³ã¨ãã¦ã¯ãã/spec/rails_helper.rbãã«ä»¥ä¸ã追å ãããã¨ã§ãã
config.render_views = true
ãããæ¸ããã¨ã§ãresponse.bodyãã«å¤ãå
¥ã£ã¦ãã¾ãã
以ä¸ã§ãã
åèè¨äº
ruby on rails - Why is JBuilder not returning a response body in JSON when testing RSPEC - Stack Overflow