tag:blogger.com,1999:blog-35289012.post8162817468022790206..comments2019-10-07T19:28:17.967-07:00Comments on Maximal Utility: Testing strong parametersClayhttp://www.blogger.com/profile/03298172406046363291noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-35289012.post-37967171254491117962014-08-05T22:54:13.980-07:002014-08-05T22:54:13.980-07:00Interesting perspective on not using require at al...Interesting perspective on not using require at all. I've wasted much time trying to figure out how to best rspec invalid cases concerning absent required parameters.Ed Esseyhttps://www.blogger.com/profile/16327936525690233716noreply@blogger.comtag:blogger.com,1999:blog-35289012.post-70589644827164848982014-01-01T14:50:07.366-08:002014-01-01T14:50:07.366-08:00Hi Clay,
The require method is useful in place o...Hi Clay, <br /><br />The <i>require</i> method is useful in place of where you have <i>fetch</i>. It ensures that some the request has data in the form that is expected and will raise the correct exception as expected if missing. <br /><br />The testing thing is different, and my post is an exploration is trying to achieve single responsibility and removing redundancy of valid and invalid attributes across actions. <br /><br />To be honest, it's not something that I've used a great deal. As you said, it's not the simplest thing to do and can add some extra weight.<br /><br />Please bare in mind this was written when Rails 4 was newly released and this was blogging about what I discovered with it.<br /><br />Cheers<br /><br />Robbie<br /> Robbiehttps://www.blogger.com/profile/08233833428126146585noreply@blogger.com