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 Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Viewing Todo Items: Part 2

jorge martinez
jorge martinez
2,294 Points

Do we have to write a test for every single line of code we do in rails ?

This course is so slow because the instructor make s a test for every single line of code he makes...

is this normal ?

wouldn't it be better to focus on creating the app, explaining the concepts of rails, and then after make a section on testing ???

6 Answers

Nikolay Batrakov
Nikolay Batrakov
9,604 Points

The purpose of writing test, as I understand it, is not to test parts of your code but rather to test functionality of your app. As Maciej told me (and I like that) just imagine a giant rat, sitting in front of a computer and testing your app as user. So writing tests is more like a way to put developer in user's shoes.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

True that :). You would normally have to manually test every single feature of your app each time you change something or add a new feature. Instead, you use Capybara (a giant rodent) that speaks RSpec and you instruct it to do the job for you, then reports all its findings to you :). Sure, you have to write some instructions for the rodent, but in the long run you save a lot of time and nerves.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

They want to prime you for working with test driven development from the very start - you will likely have to work this way when you start a Rails dev job somewhere. Make you used to writing tests and (preferably) writing them first. Ignore the testing parts if you don't want them. I did that, but then resented my decision, because then I had to learn Rspec from scratch and writing tests on a completed project is very chaotic.

Bryn Price
seal-mask
.a{fill-rule:evenodd;}techdegree
Bryn Price
Full Stack JavaScript Techdegree Student 7,253 Points

I found the testing side of things confusing and made it harder to follow the rest. I can understand the importance of testing and want to cover it. Unfortunately I kept running into errors and didn't understand how to correct them.

I think it may have been more appropriate to how the rest of the track works is to have a module on a testing environment, perhaps it could be view that's what this module is.

But my way around this is that I am first following: http://teamtreehouse.com/library/build-a-simple-ruby-on-rails-application which seems to work better for me. It breaks a little more down and has a separate section on doing tests.

It is an extra 8 hours on top of your current curriculum, but I dunno if it helps things easier to understand. Or as Justin says, hang in there. :P

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Just remember that it uses old version of Rails and other gems that no longer work properly and that testing is done using a different testing framework.

Brett Bird
Brett Bird
2,659 Points

I'm fine with them starting us off the right way, making tests... but there's really no explanation of the commands for the tests either. It just says "install these" and then we just follow away. I can piece together what's happening but really haven't gotten any explanations of the syntax AT ALL. He talks like we have already reviewed all of this.

It's also completely unlike the teaching styles of the entire track so far and most Treehouse courses. Also, as someone else pointed out, a lot of people have no idea what an MVC is so all of this jumping around is probably even more confusing to them.

John Simoneau
PLUS
John Simoneau
Courses Plus Student 8,105 Points

On a positive note... I'm now very grateful that it's a "Simple To-Do App" that we are building. Could you imagine all the testing we'd be doing if it was a complex app?...LOL. The course would take a year to complete!

Honestly, I'm getting more and more comfortable with the testing and starting to understand it. That's the good part about repetition. I was getting frustrated not learning some of the syntax but at random times he actually explains bits and pieces as he goes. Sometimes that's way after you first used the syntax but at least he does cover portions of it that you wouldn't expect if you didn't continue on with the course.

I'm not job hunting but I'd like to learn the way it would be handled in a true production environment as if I was.If I ever team up with other developers later on then I would certainly want to be sure they practice the same professional workflow even if it's the less exciting one. User experience needs to come first, I've learned that over the past several years of web development and managing websites. I wish I learned it earlier so I think this way of teaching might help with that substantially. In the end that means more money in my pocket as a website owner or developer right?

Hang in there. I felt the same way.

Everything was fuzzy and confusing for me (concerning Rails) until I reached Hampton Catlin's Active Record course later in the track, where he talks to you like you're just hanging out.