Do RSpec stories make view specs redundant? Does anybody spec their views *and* use stories, and if so how? Any views (no pun intended) appreciated. ~ Thanks Mark -- Posted via http://www.ruby-forum.com/.
Mark Dodwell wrote:> Do RSpec stories make view specs redundant?Sorry I should clarify that I''m talking about Rails view specs specifically here. -- Posted via http://www.ruby-forum.com/.
On 5/23/08, Mark Dodwell <lists at ruby-forum.com> wrote:> Do RSpec stories make view specs redundant? Does anybody spec their > views *and* use stories, and if so how? > > Any views (no pun intended) appreciated. > > ~ Thanks > > Mark > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >Not necessarily. You might test one or two paths through stories, and unit test remaining branches in your views. Pat
On 23 May 2008, at 19:27, Pat Maddox wrote:> Not necessarily. You might test one or two paths through stories, and > unit test remaining branches in your views.I''ll go with this. I stopped writing view specs but I can see you could get in a situation where you have more permutations in a view than you want to test through the stories. However, I''d want to establish that that wasn''t just a sign of un-refactored code. Right now I''m leaning towards stories only unless I come up with a pressing need for specs. Ashley -- http://www.patchspace.co.uk/ http://aviewfromafar.net/
Thanks for the comments. This might be more obvious, but what about rails integration tests -- presumably RSpec stories make these redundant for sure? -- Posted via http://www.ruby-forum.com/.
On May 23, 2008, at 2:34 PM, Mark Dodwell wrote:> Thanks for the comments. > > This might be more obvious, but what about rails integration tests -- > presumably RSpec stories make these redundant for sure?RailsStory (in RSpec) wraps rails integration tests. So not only redundant, but the same thing and repetitive all at the same deja-vu- all-over-again moment!
On Fri, May 23, 2008 at 12:34 PM, Mark Dodwell <lists at ruby-forum.com> wrote:> Thanks for the comments. > > This might be more obvious, but what about rails integration tests -- > presumably RSpec stories make these redundant for sure?Yeah, stories can serve the same role as integration tests. Pat
On May 23, 2008, at 2:54 PM, Pat Maddox wrote:> On Fri, May 23, 2008 at 12:34 PM, Mark Dodwell <lists at ruby- > forum.com> wrote: >> Thanks for the comments. >> >> This might be more obvious, but what about rails integration tests -- >> presumably RSpec stories make these redundant for sure? > > Yeah, stories can serve the same role as integration tests.Funny - I always looked at it the other way around - treating rails integration tests as something close to stories.> > > Pat > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On 23 May 2008, at 20:48, David Chelimsky wrote:> RailsStory (in RSpec) wraps rails integration tests. So not only > redundant, but the same thing and repetitive all at the same deja-vu- > all-over-again moment!Is there a Don''t Deja-vu Yourself principle we should be following? :) -- http://www.patchspace.co.uk/ http://aviewfromafar.net/
On Fri, May 23, 2008 at 12:58 PM, David Chelimsky <dchelimsky at gmail.com> wrote:> On May 23, 2008, at 2:54 PM, Pat Maddox wrote: > >> On Fri, May 23, 2008 at 12:34 PM, Mark Dodwell <lists at ruby-forum.com> >> wrote: >>> >>> Thanks for the comments. >>> >>> This might be more obvious, but what about rails integration tests -- >>> presumably RSpec stories make these redundant for sure? >> >> Yeah, stories can serve the same role as integration tests. > > Funny - I always looked at it the other way around - treating rails > integration tests as something close to stories. > >> >> >> Pat >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >I think that Rails integration tests are very effective integration tests. Although you can make them quite expressive, I still wouldn''t show them to a customer. User stories *can* serve that same role, though doing so misses the key benefits. Pat
On 5/23/08, Mark Dodwell <lists at ruby-forum.com> wrote:> Do RSpec stories make view specs redundant? Does anybody spec their > views *and* use stories, and if so how? > > Any views (no pun intended) appreciated.Our team has been talking a lot about this subject recently as we made a decision at the beginning of the project to skip view specs in favor of stories which has left us with a suite of stories which is now taking roughly 5 minutes to run. Upon investigation I''ve noticed that many of our stories are things that a simple view-spec would cover, and am now starting to move logic back into view specs. -- Josh Knowles phone: 509-979-1593 email: joshknowles at gmail.com web: http://joshknowles.com