Hi Nigel, The rspec-rails gem is aimed at providing integration between the Rails test helpers and RSpec proper, as such it's not aimed at full stack testing, but producing integration and unit tests for various Rails components. Thus the `get`/`post` helpers etc from rspec-rails are aimed at testing controller actions, rather than a full end to end path…
Capybara on the other hand is aimed at building those end-to-end acceptance tests, going from view to view, and thus has lots of niceties for integrating with the dom. It ships with the javascript-less rack-test driver and Selenium for driving real browsers, there are also various extension gems (such as poltergeist and capybara-webkit) which allow headless testing of javascript. So they are different tools for different uses. Good luck! Jon Rowe ----------------------------- [email protected] jonrowe.co.uk On Wednesday, 1 May 2013 at 06:38, Nigel Sheridan-Smith wrote: > Hi guys, > > Just trying to figure out how all this Rails testing and TDD stuff works... > I've put it off for far too long. > > I think I've worked out how RSpec integrates with Rails now (that was > particularly confusing for a bit!)... basically the rspec-rails gem mixes in > the classes ActionView::TestCase::Behavior and > ActionController::TestCase::Behavior depending on where your spec_*.rb file > is located. So that at least explains where methods like "get", "post" and > "response" come from. > > So what, then is the advantage of using Capybara over the standard ::Behavior > classes? Is it tremendously better to start with Capybara first? > > ... thinking it might be time to buy those books :D > > Cheers, > > Nigel > > > On Thu, Aug 16, 2012 at 10:58 PM, Heitor Andrade <[email protected] > (mailto:[email protected])> wrote: > > Thanks guys! > > I'll start by Rails 3 in Action then i'll try RSpec! > > > > Att, > > Heitor Andrade > > > > > > > > 2012/8/15 Rob Zolkos <[email protected] (mailto:[email protected])> > > > Hi Heitor, welcome to the group. > > > > > > Ryan is being a bit modest. His book Rails 3 in Action is the best way > > > to learn a real world example of TDD techniques as they relate to Rails > > > (especially in the context of writing tests first). > > > > > > > > > > > > thanks, > > > Rob > > > > > > > > > > > > On Thu, Aug 16, 2012 at 8:46 AM, Ryan Bigg <[email protected] > > > (mailto:[email protected])> wrote: > > > > Hi Heitor, > > > > > > > > I'd say that the RSpec Book by David Chelimsky and co. is a good start > > > > in just understanding the concepts behind TDD without Rails. > > > > http://pragprog.com/book/achbd/the-rspec-book. > > > > > > > > If you're looking for a free resource to learn about TDD within the > > > > context of Rails, there's Michael Hartl's Rails Tutorial, which covers > > > > creating a microblogging service in Rails and tests it using RSpec and > > > > (I think) Capybara as well: http://ruby.railstutorial.org/. > > > > > > > > I wrote a book called Rails 3 in Action which covers creating a basic > > > > project management system, using RSpec and Capybara too. You can get > > > > early access to the second edition here: http://manning.com/bigg2. > > > > > > > > Welcome to the group :) > > > > > > > > > > > > On Thursday, 16 August 2012 at 8:36 AM, Heitor Andrade wrote: > > > > > > > > > Hello! > > > > > I'm new on Rails and I developed a simple website with no problems, > > > > > but I used to use TDD, and i'm having a lot of trouble to understood > > > > > how it works on RoR, I read somethings about cucumber and spork, but > > > > > I'm looking for some tutorial or book, someone have anything to > > > > > indicate to me? > > > > > PS: Sorry about my english, I'm studing yet... > > > > > > > > > > Att, > > > > > Heitor Andrade > > > > > > > > > > -- > > > > > You received this message because you are subscribed to the Google > > > > > Groups "Ruby or Rails Oceania" group. > > > > > To post to this group, send email to [email protected] > > > > > (mailto:[email protected]). > > > > > To unsubscribe from this group, send email to > > > > > [email protected] > > > > > (mailto:[email protected]). > > > > > For more options, visit this group at > > > > > http://groups.google.com/group/rails-oceania?hl=en. > > > > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Ruby or Rails Oceania" group. > > > > To post to this group, send email to [email protected] > > > > (mailto:[email protected]). > > > > To unsubscribe from this group, send email to > > > > [email protected] > > > > (mailto:rails-oceania%[email protected]). > > > > For more options, visit this group at > > > > http://groups.google.com/group/rails-oceania?hl=en. > > > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Ruby or Rails Oceania" group. > > > To post to this group, send email to [email protected] > > > (mailto:[email protected]). > > > To unsubscribe from this group, send email to > > > [email protected] > > > (mailto:rails-oceania%[email protected]). > > > For more options, visit this group at > > > http://groups.google.com/group/rails-oceania?hl=en. > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby or Rails Oceania" group. > > To post to this group, send email to [email protected] > > (mailto:[email protected]). > > To unsubscribe from this group, send email to > > [email protected] > > (mailto:rails-oceania%[email protected]). > > For more options, visit this group at > > http://groups.google.com/group/rails-oceania?hl=en. > > > > -- > e: [email protected] (mailto:[email protected]) > m: +61 403 930 963 > > Get together for fun activities at www.joinsomeone.com > (http://www.joinsomeone.com/) > > Like us on Facebook www.facebook.com/JoinSomeone > (http://www.facebook.com/JoinSomeone) > Follow us on Twitter @JoinSomeone > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby or Rails Oceania" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > (mailto:[email protected]). > To post to this group, send email to [email protected] > (mailto:[email protected]). > Visit this group at http://groups.google.com/group/rails-oceania?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/rails-oceania?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
