Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Request for a Deep Dive course on Rspec

I don't know if this is the right place to do it, but it would be great to have a "Deep-dive" course on RSpec and other testing utilities such as Factory-girl, Selenium, Cucumber and more.

I went through some of the Rails track on Treehouse, and while we have a good introduction of Git, Ruby, and other stuff, I feel the foundations of RSpec is bit weak.

When we start working on the Odot app, we directly start creating Feature specs, but we don't learn the different aspects of RSpec. This new course could maybe cover the following:

  • Why do we have to create the Features specs manually and not others?
  • What are Views specs for? How to use them?
  • How do Views specs differ from Features specs?
  • What are Requests specs versus Routing specs?
  • How do we test Javascript and Ajax using RSpec and Selenium
  • When to create and not to create objects with Factory Girl vs. declaring manually the object each time? etc...

It would be great to have a course that explains these different kinds of specs, how to use them, and how they are useful. I have been using RSpec 3, which has some differences with RSpec 2, and it makes the structure of RSpec even more confusing.

Also I have seen other developers completely omitting the use of Views and Requests specs, and I don't know why?

So far the most comprehensible explanation of RSpec for me is provided by Thoughtbot here http://robots.thoughtbot.com/how-we-test-rails-applications

What do you think? Is this possible?

1 Answer

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Agreed. I always had problems with tests, I just copied them from lessons and wasn't really able to write them on my own. But as you are waiting for the deep dive on the topic, you may want to try this book:

https://leanpub.com/everydayrailsrspec

I found it VERY comprehensive and helpful. You even get older versions for RSPec 2 and Rails 4.0 (the newest RSPec 3 has some change sin syntax). It covers Capybara, Factory Girl, Faker etc.

Awesome, thank you @Maciej Czuchnowski for sharing the Book. Just bought it for my reading it on my iPad.